May 10th, 2012
A few fixes/enhancements might cause you some grief
After running PHP 5.4 on my development environment for a while I have hit several things that could easily cause enough grief that they need calling attention to. These are new features or changes that will break some existing edge cases in somewhat hidden or obscure ways and can take a long time to find if you don´t know what you´re looking for.
Call Time Pass By Reference prohibited:
I found 3rd party code (bank payment processing) that had call time pass by reference.
It failed with no errors & no warnings until I tested the specific include with php -l Otherwise there is no error just silent failure - and when that is deep in external code it´s a nightmare to find. To fix it: just remove the & they are no longer necessary.
max_input_vars:
This is a new setting (since 5.3.9) that can only be adjusted in the php.ini .htaccess, or httpd.conf locations. It sets the maximum number of variables (including array elements) that can be sent to the server at one time and is defauled to 1000 (they did this to prevent hash collision attacks). The gotcha here is if you have a large form with many options in it $_REQUEST or $_POST can easily surpass that quantity of elements. What makes it worse, the error you get will likely show up in your web browser as client side generated
Unsupported Compression Type
- NOT easy to diagnose. You can only find it if you check the errors_log and see things like this:
PHP Warning: Unknown: Input variables exceeded 1000
Hope these help you in your PHP travels.