tags:

views:

1207

answers:

4

PHP version 5.3 has been released, and although it looks great, all my code already works fine. I don't see what this new version offers to justify upgrading and working through possible issues after the upgrade.

Should I upgrade anyway just for good practice, or is an upgrade not needed unless I am actually using the new features?

+11  A: 

You might consider upgrading just for the "Improved PHP runtime speed and memory usage" and bug fixes. Source. I would also say that if you are using create_function anywhere, you should upgrade and replace that ugly, nasty mess, with the much cleaner lambda. Here is the migration guide from 5.2.

docgnome
Tchalvak
A: 

I am pondering the same thing... if anything upgrade for the bug fixes, but make sure to check compatibility, a few things have changed in this version (goto, namespaces, parameter parsing, mhash, etc...),

replacing create_function with lambdas should be enough in itself to upgrade, the memory usage and overhead using create_function is ridiculous.

check the migration guide http://us.php.net/migration53

Jason
Compatibility is my main issue.
Charlie Somerville
Yep. I'd love to upgrade to 5.3 to try out new features, but I don't want to solo the process of debugging discrepancies between 5.2.6 and 5.3 just to try out the new stuff.
Tchalvak
+1  A: 

There are two things that might interest you, the first is replacing create_function()s with lambdas, the other is looking into late static binding. Now that LSB is available, there are a few things that can be resolved in a much much cleaner and more efficient way.

Personally, I was anticipating traits, but it didn't get included in this version. I was so sad when I found out :(. Now I don't even remember why I thought it would be included in 5.3.

WishCow
+1  A: 

I'd say there's a few big questions you need to answer to help make this decision. The biggest of which is, what does your site/product/customers do? If you're managing an application (like say a CMS or shopping cart) then you need to understand that many hosts will not be upgrading for a while because they wait for officially supported packages/RPMs for the OS they use, and they take time to build, test and release.

If this is just a custom site running on a dedicated server the same question can be some what important. While, in this case, you can always compile by hand that may not necessarily be the best idea if you're as anal about a clean, organized, server as I am. Like Jason mentioned, there are supposed to be significant speed improvements, and as WishCow said, if you use create_function() you can now ditch them for cleaner code.

Also keep in mind any third party libraries/extensions (PECL, PEAR, Zend Framework, Drupal, Wordpress, or custom written) that you're using that may not work on 5.3 yet for any given reason.

A dry-run upgrade is always better if it's possible. I have a server sitting next to my desk at home that I can use to upgrade and turn on a profiler to see what the performance of my site(s) looks like and make sure everything works. If you can't do this then you have to be careful because there's a chance you'll have some down time if things don't go smoothly.

Steven Surowiec