Yii Framework Forum: PHP 5.3 and Yii - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

PHP 5.3 and Yii Rate Topic: ***** 3 Votes

#1 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,899
  • Joined: 04-October 08
  • Location:DC, USA

Posted 30 June 2009 - 10:28 AM

The highly anticipated PHP 5.3 is formally released. This version introduced many exciting features to the PHP language itself, such as namespaces, late static binding, closures, etc. It brings PHP to a new level. We hereby congratulate the PHP developer team!

Yii framework should be compatible with PHP 5.3. If you find any problem, please let us know. Thanks.

We are not going to exploit these new PHP 5.3 features in the near future in the core framework code for the following reasons:

1. Using the new features may introduce significant backward compatibility problem.

2. Using the new features would mean raising the basic requirements of using Yii to PHP 5.3. We expect that PHP 5.3 needs several minor releases before getting stable enough.

3. While namespace is cool, the strategy of prefixing all Yii core classes with letter 'C' works very well. It may be treated as a different form of namespace.

4. Late static binding would allow us to use Post::findAll() instead of Post::model()->findAll(). It is true that the former is more pretty; however, the latter also has its own benefits because Post::model() is an object instance and can be stored in a variable.

While the Yii core code does not use 5.3 elements, application code built on top of Yii has full freedom to exploit them.

We may consider rewriting Yii 2.0 on top of PHP 5.3, but this won't happen in the near future.

Please let us know if you have any comments on our decisions above. Thank you.
0

#2 User is offline   sAe 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 18-May 09
  • Location:Sweden, Karlstad

Posted 30 June 2009 - 11:14 AM

Sounds really interesting, i thought they were saving up all the new stuff for the 6.0, but i was mistaken. :)

I like the idea of namepaces but i prefer having a prefix like we do now.
But hey, i'm not conservative, i wouldn't mind using them either  8)
0

#3 User is offline   Fred Wu 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 27
  • Joined: 02-March 09
  • Location:Melbourne, Australia

Posted 01 July 2009 - 05:00 AM

I know I will be using PHP 5.3 because I have control over the server environment (and by the time my project launches, PHP 5.3 will already be stable enough). Gotta love closures and late static binding. :)

Most of the shared hosting environments won't have 5.3 for at least a couple of months, I think it is a sane choice to have the core stay backward compatible.
1

#4 User is offline   kingheaven 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 23-March 09

Posted 01 July 2009 - 12:03 PM

I am a huge fan of Yii, so I really want to see Yii have great features. ;D

For upgrading to PHP 5.3, this is just what I thought this afternoon. As PHP 5.3 is newer and may be better than 5.2, but it really needs time to prove this. Yii is a very strong and effient framwork for developing, so it must confirm that it can run on most of servers, which is for PHP 5.2.  :P

And for PHP 5.3, I think it's great to support this on Yii 2.0. At that time, maybe 5.3 is everywhere, so we won't worry about the server problem. :D

That's my little advice for Yii developing, and I really hope Yii will get better and better in the future. ;)

At last, I really appreciate for what you did. I can see you answered almost every questions in Chinese board. You're really my hero!  :D
0

#5 User is offline   pestaa 

  • past Yii dev member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 705
  • Joined: 07-May 09
  • Location:Hungary

Posted 01 July 2009 - 02:17 PM

I love keeping up with the latest stable versions, although I never use brand new features out of PHP. I even dislike the idea of namespaces, as I mostly work on small projects and I don't need additional complexity.

Speaking of future plans - how many releases are planning to make in the 1.0.x branch, Qiang?
0

#6 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,899
  • Joined: 04-October 08
  • Location:DC, USA

Posted 01 July 2009 - 02:55 PM

We will continue releasing 1.0.x, mainly to fix bugs, until December 31, 2010, the scheduled end of 1.0 maintenance. We expect future 1.0.x versions will be released in a slower pace (e.g. a release every 2 or 3 months).
0

#7 User is offline   diehard 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 04-March 09

Posted 02 July 2009 - 03:02 PM

PHP 5.3 has up to 30% more performance than PHP 5.2!

In my humble opinion, I still wish Yii to keep ahead of other frameworks in exploiting the newest and greatest features/performances from PHP (like native MySQL driver, for performance). I'm doing ASP.NET C# for enterprise apps and I'm cheering for PHP as a programming language to get up to speed.

But, I do agree Yii should wait for sane number of months until one-third of shared hosting environments support PHP 5.3 (e.g. DreamHost) and few more future maintenance updates to stabilize PHP 5.3. I don't mind Yii breaking changes to support PHP 5.3, if we have a upgrade guide.

More performance from PHP 5.3 language itself:
http://schlueters.de...rmance-win.html
More performance using Native MySQL Driver:
http://dev.mysql.com...or/php-mysqlnd/




1

#8 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,899
  • Joined: 04-October 08
  • Location:DC, USA

Posted 02 July 2009 - 04:02 PM

The post doesn't mean Yii won't work with PHP 5.3... It mainly states that the core framework code will not use the language features offered by PHP 5.3, at least in the near future.
0

#9 User is offline   chanh 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 86
  • Joined: 09-March 09
  • Location:Seattle

Posted 02 July 2009 - 10:47 PM

It will take a long time for majority of share host to upgrade to 5.3.  Look how long it took for the share host to support 5.x

I think qiang is doing the right thing to ensure backward compatibility.  It is very important for wide adoption.
0

#10 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 04 July 2009 - 08:56 AM

I haven't seen this thread when I posted a question on 5.3 support, sorry.

I agree, 5.3 will take a long time to be adopted, so it'd be smart to avoid using the new features.
0

#11 User is offline   GoofyX 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 167
  • Joined: 15-April 09
  • Location:Thessaloniki, Greece

Posted 04 July 2009 - 11:29 AM

Keeping backwards compatibility is not always a win-win situation. Other frameworks, like Drupal for example, do not keep backwards compatiblity in each major version (minor versions are security-fixes), which means that third-party modules have to adapt to new versions. The big plus in this, is that you don't have to carry all the old-for-the-sake-of-compatibility stuff in each new version and has proved a wise decision so far. So my point is, Yii doesn't have to be backwards compatible in each new major version. If you wish to use PHP 5.3's new features, then do so in your next major revision, just document the changes and warn developers ahead from this.
0

#12 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 06 July 2009 - 04:21 PM

Well well, I'm testing PHP 5.3.0 with a rather old and big Prado-based system, and kaboom, an error in code, the cause:

All POSIX Regex function will be deprecated in PHP 5.3. This will cause notice when E_STRICT is on :
Function split() is deprecated in aaa.php on line xxx

To resolve this you can replace split by explode(). You should take this into account on your old or new code!! (also take into account that ereg functions will not exist in PHP 6!!!!!!)

Also, some extensions don't compile on 5.3.0, so far tested: adodb and perl  ::)


0

#13 User is offline   jouy 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 13-July 09

Posted 16 July 2009 - 08:25 PM

like rails, backwards compatibility is not the most important.

from 1.0 to 1.2, keep 1.x stable

i think 2.0 is important milestone.

I believe that yii is the best



0

#14 User is offline   Tarun Jangra 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 09-July 09

Posted 20 July 2009 - 02:32 PM

No doubt, PHP 5.3 is have really great features. But as far as yii is concerned. It's better to keep it on 5.2 untill 5.3 does not get proved.
--------------
Regards,
Tarun Jangra
http://www.tarunjangra.com
0

#15 User is offline   diehard 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 04-March 09

Posted 22 July 2009 - 08:30 PM

Reading my daily www.phpdeveloper.org news, I find one framework taking full advantage of PHP 5.3 and unsurprisingly moving fast, CakePHP.

Article on PHP 5.3 and CakePHP 3.0:
http://debuggable.co...ee-6d284834cda3

Source Code: Development already started on PHP 5.3 called CakePHP 3.0
http://code.cakephp.org/cake3
1

#16 User is offline   resplendent 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 60
  • Joined: 22-May 09
  • Location:Singapore

Posted 03 August 2009 - 02:55 AM

Hi there,

i just updated my php from 5.2 to 5.3 in windows using apache server with 27Jul09 browscap.ini. but has met with problem occurred by either CHttpRequest::browser or get_browser or browscap.ini. none of my browsers can be detected by get_browser function. it stated:

stdClass Object
(
    [browser_name_regex] => �^.*$�
    [browser_name_pattern] => *
    [browser] => Default Browser
    [version] => 0
    [majorver] => 0
    [minorver] => 0
    [platform] => unknown
    [alpha] => 
    [beta] => 
    [win16] => 
    [win32] => 
    [win64] => 
    [frames] => 1
    [iframes] => 
    [tables] => 1
    [cookies] => 
    [backgroundsounds] => 
    [cdf] => 
    [vbscript] => 
    [javaapplets] => 
    [javascript] => 
    [activexcontrols] => 
    [isbanned] => 
    [ismobiledevice] => 
    [issyndicationreader] => 
    [crawler] => 
    [cssversion] => 0
    [supportscss] => 
    [aol] => 
    [aolversion] => 0
)


did anyone experience the same problem?

thanks.
0

#17 User is offline   resplendent 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 60
  • Joined: 22-May 09
  • Location:Singapore

Posted 26 August 2009 - 09:55 PM

View Postresplendent, on 03 August 2009 - 02:55 AM, said:

Hi there,

i just updated my php from 5.2 to 5.3 in windows using apache server with 27Jul09 browscap.ini. but has met with problem occurred by either CHttpRequest::browser or get_browser or browscap.ini. none of my browsers can be detected by get_browser function. it stated:

stdClass Object
(
    [browser_name_regex] => �^.*$�
    [browser_name_pattern] => *
    [browser] => Default Browser
    [version] => 0
    [majorver] => 0
    [minorver] => 0
    [platform] => unknown
    [alpha] => 
    [beta] => 
    [win16] => 
    [win32] => 
    [win64] => 
    [frames] => 1
    [iframes] => 
    [tables] => 1
    [cookies] => 
    [backgroundsounds] => 
    [cdf] => 
    [vbscript] => 
    [javaapplets] => 
    [javascript] => 
    [activexcontrols] => 
    [isbanned] => 
    [ismobiledevice] => 
    [issyndicationreader] => 
    [crawler] => 
    [cssversion] => 0
    [supportscss] => 
    [aol] => 
    [aolversion] => 0
)


did anyone experience the same problem?

thanks.


Hi all,

Problem has been resolved. I have go for another way to retrieve browser header provided by PHP comments.

Cheers.
0

#18 User is offline   jerry2801 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 504
  • Joined: 18-November 09

Posted 18 November 2009 - 03:32 AM

View Postresplendent, on 26 August 2009 - 09:55 PM, said:

Hi all,

Problem has been resolved. I have go for another way to retrieve browser header provided by PHP comments.

Cheers.


希望能够早日看到 yii 2.0~
0

#19 User is offline   robregonm 

  • Expert Yii Developer
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 595
  • Joined: 30-July 09
  • Location:Colombia

Posted 18 November 2009 - 12:20 PM

I've not experienced any problem with my current configuration:
  • Apache 2.2
  • PHP 5.3
  • Ubuntu Server 9.10
  • MySQL 5.1, PostgreSQL 8.5-dev, Firebird 2.5
  • Yii 1.0.11-dev

However, it is necesary to add the line below to my php.ini file:
date.timezone = America/Bogota

Obviously, Each server has his own configuration.

The above line is for not having problems with date functions.

Regards,

Ricardo
Ricardo Obregón

YiiFramework en Español - http://yiiframework.co/ - http://yiiframeworkenespanol.org/ - Yii Code Generator for Bootstrap
http://obregon.co/ - https://1server.co/
PHP 5.5+, nginx 1.7, MySQL(MariaDB & PerconaDB), PostgreSQL 9, Yii 2, CanJS
Follow me: @robregonm & @obregonco & @1ServerCo.
0

#20 User is offline   androidmacc 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 16-June 10

Posted 15 August 2010 - 06:39 PM

Did anyone resolve this issue using 5.3 and yii.. I am hopeing someone has but this bug to rest...


Error 500
date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users