PHP – Upgrade to PHP 5.3.x – Things to Look out for
When upgrading to php 5.3.x there will be some issues to look out for before you deploy to production, this thread is meant to contain those issues for easy reference.
date.timezone (php.ini)
PHP developers decreased the error level for not initializing timezone correctly, adjusting from strict to warning. Chances are you will start to see some warnings surrounding your date() calls. To rectify this, simply make the following change to your php.ini file:
date.timezone = America/Los_Angeles
Make sure the entry is uncommented, and set the value to whichever value you need (a list can be found @ http://us3.php.net/manual/en/timezones.php)
__toString()
In PHP 5.3, the magic __toString() methods no longer allow you to pass in arguments, which makes sense on some level, but does reduce flexibility.
substr()
Just found out about this one recently. According to some comments from the PHP docs on substr, in 5.2 php internally cast the 2nd argument; start, to an int. So if you put in a string it would probably just cast to 0, and not error out. However in php 5.3, these errors started showing up, so I had to convert all substr calles to stripos calls, where it made sense of course.
PDO Bind Param – Pass by Reference
Just came across another one.
// Results in pass by reference warning $stmt->bindParam(1, $object->getValue()); // How to fix $value = $object->getValue(); $stmt->bindParam(1, $value);

One thing I found, if you’re using the latest version of libxml with PHP 5.3, the SOAP library will fail when trying to access remote WSDLs. The workaround is to use copy() to download the WSDL locally and then load it into the SOAP constructor as a data string. Still hasn’t been fixed., pretty lame.
http://bugs.php.net/bug.php?id=48216&edit=2