PHP6 - A look ahead

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

PHP6 - A look ahead

Post by Roja »

There is a really solid summary of the changes coming in PHP6: http://jero.net/blog/2006/03/php6/

- Unicode
- No more register_globals, magic_quotes, safe_mode!
- No long arrays ($http_cookie_vars)
- APC cache included by default
- Namespaces
- Major changes to extensions

It looks like a breath of fresh air. Less legacy, smaller core (moving things out to extensions), and better functionality (unicode).

The internals list just started tackling the issue of the performance differences between php4.4 and 5.1 as well, so hopefully we will see performance improvements also.

Exciting stuff!
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Brilliant... I'm really looking forward to getting a copy and having a play around with the new OOP stuff. It'll be interesting to see how the namespace handling all works :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

sweeeeeeet sticky goo.... *gurgle*
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

proper unicode-support will make life so much easier...
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

Worth noting for php with utf-8 that Harry Fuecks has developed a library of utf-8 compatible sting functions, etc for PHP4+. http://sourceforge.net/projects/phputf8 which does not require mbstring availability (uses it if available however).

PHP6 is looking like a good step forward. It's going to break compatibility on some points but I think the cost is a lot less than the PHP4 to PHP5 move - the same PHP4 criminals will probably still whine though which probably means it'll be as well received as PHP5 has been so far. Hopefully it'll result in some weird and wonderful move towards large scale adoption, though that's probably wishful thinking...

Main thing I worry about is that essentially if you are creating any open source application for public consumption (read: anyone and everyone) PHP5 is already a no-go. As long as that vicious circle persists these great new features and cleanups are going to be unuseable by the majority.

I'm a pessimist in this case I know...;)
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

I agree with Maugrim_The_Reaper.. I used to look forward to upcoming features.. But after a while i notice that most webhosts don't upgrade and the new features remain inaccessible it turned me down...
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Maugrim: Zend Framework has already breached that barrier, so I would expect to see a lot more applications developed in php5 (opensource or not)
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

The list for PHP6 looks very good. Unfortunately because they are focused on Unicode they will probably not provide and OO enhancements. I get the impression that they don't think they are needed, but a little time with Zend Framework may change that opinion. Mixins, multiple _autoload()'s and real accessor support would be on my list before namespaces.

Jcart makes an interesting observation. It is getting to the point where unless you use a framework there is too much pain to upgrade major versions. At this point it may make sense to start building stuff on top of a supported framework that is going to make the PHP5->PHP6 jump for you.
(#10850)
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

Maugrim_The_Reaper wrote:Main thing I worry about is that essentially if you are creating any open source application for public consumption (read: anyone and everyone) PHP5 is already a no-go. As long as that vicious circle persists these great new features and cleanups are going to be unuseable by the majority.
I think its going to come to a head rather soon.

At some point, the PHP internals team won't maintain PHP4 any longer. It makes zero sense to maintain *three* trees. When that happens, hosts may stubbornly stick with PHP4 - until a security issue forces the issue.

The day that a security breech occurs, and PHP doesn't have a solution except "upgrade a major version number", then we will see adoption.

However, even ignoring that "use the stick" option, I think hosts have enough reason to want to jump to PHP6. Notably, they gain a built-in cache (reduces impact, increases performance). In addition, I've seen discussions by a few people about FINALLY fixing the stack/security issue. (aka, I can make an infinite loop as a user, and take up 100% of cpu on a shared server).

Those two alone are a massive incentive to migrate. Then when you factor in fewer security fixes and updates, it gets sweeter. Kick in unicode support, frameworks, and more? Yeah, its a pretty attractive package.

I was (and continue to be) extremely pessimistic about PHP5 *ever* gaining a widespread adoption rate. PHP6, on the other hand, I suspect it might go fairly well.
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

Roja wrote: However, even ignoring that "use the stick" option, I think hosts have enough reason to want to jump to PHP6. Notably, they gain a built-in cache (reduces impact, increases performance). In addition, I've seen discussions by a few people about FINALLY fixing the stack/security issue. (aka, I can make an infinite loop as a user, and take up 100% of cpu on a shared server).
Funny! I did that once with some ADODB stuff by accident our server (wasn't shared). If I remember right I fed a connection object back into a Execute statement or something like that. I never tracked the issue back to the source but now that you mention it sounds kinda familar.

So the real question is what Framework will emerge the victor?
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post by Buddha443556 »

I have one host finally lunching PHP5. Hopefully, I'll see it sometime before July. What's that 3 years? Heck could be dead before I see PHP6 at this rate. Or using Java with Tomcat!
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

timvw wrote:I agree with Maugrim_The_Reaper.. I used to look forward to upcoming features.. But after a while i notice that most webhosts don't upgrade and the new features remain inaccessible it turned me down...
I second that...tis why i'm still php4 :(
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

I've got PHP 5 on a shared host. So for my own stuff I can do PHP 5. Otherstuff .. Ummm PHP 4 :cry:
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

Jcart wrote:Maugrim: Zend Framework has already breached that barrier, so I would expect to see a lot more applications developed in php5 (opensource or not)
Its not current or future applications - it's the legacy apps that persist the problem. Until they are forced to update somewhere along the line (not likely unless they're being actively maintained) PHP4 will remain a requirement for these - at least for them to work without certain known issues.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I don't get it. Hosts can run both versions... I do on my VDS.

When you sign up for hosting they can just ask if you want PHP4 or PHP5. You could even have the option to switch via a control panel.
Post Reply