11.02.06
PHP 5.2 Released
PHP 5.2 is finally released. If you are using 5.0.x or 5.1.x it is recommended that you upgrade. The number of bugfixes and feature enhancements are kind of staggering.
Here are some highlights:
- E_RECOVERABLE_ERROR was added - basically a recoverable fatal error. Eventually this will replace fatal errors that may muck up your project, but don’t muck up the engine itself - this has also changed the value of E_ALL
- __toString works in more places (like concatenation) - but objects still can’t be used as array keys (use spl_object_hash()) to get around it
- Using remote files has been split into two seperate ini entries - allow_url_fopen allows basic file manipulation but not including the files, allow_url_include controls remote file inclusion and is off by default
- Some “OO purity” checks have been added, and fought over…and finally most regulated to simply E_STRICT
- abstract static methods are no longer allowed (this is a real point of contention - check the mailing list for further madness)
- constructors can be in interfaces so you can force argument/return signatures in implemented classes
- other junk - check the news file included with the download and the upgrade file for further information
- Extension changes - some added, some removed
- Memory manager improvements and new default memory limit
- Hooks for file upload progress implementations (still needs an extension to work - can we get this into pecl sometime soon?)
The bottom line? PHP 5.0.x is really old. PHP 5.1.x is officially obsolete. Upgrading hurts, but an exploited PHP bug would hurt more.
One more item - there is a really nice new windows installer for PHP. It can set up basically every sapi available plus cgi - that means Apache in all its incarnations, IIS, the list goes on. It also allows you to set up additional extensions (the trick is to open the extensions tree on the “Choose Items to Install” page and pick the ones you want…not very intuitive I know) One more caveat? Windows gets so little love that even the link on the downloads page is wrong, and the server is incorrectly sending headers for the msi. Internet Explorer totally ignores this and still downloads it properly. One time when their stupidity comes in handy. But in Firefox you have to open the file in a new tab, immediately head to “save page as” and then close the tab quick before it kills your browser! If you’re a windows user head to the real download the msi and enjoy how easy it is to install PHP on windows
Update: the link issue has been fixed and should propogate to all the mirrors



Rasmus said,
November 3, 2006 at 11:56 am
Support for those hooks have been in APC for a while now. See the example at:
http://progphp.com/upload.php
Source at:
http://progphp.com/upload.phps