PHP 5.3 Breaks “many things”

January 9, 2012

“PHP 5.3 brought many problems due to the PHP authors’ decisions to . . . break many things…”

Also, they initiated the warnings of more things they intend to break in PHP 6.

Be sure your error reporting is turned on: (for your testing copy or for your IP address)
@ini_set('display_errors', '1');
error_reporting(E_ALL ^ E_NOTICE);
# or
error_reporting(E_ALL);

“PHP 5.3 breaks AtMailOpen.” “I tried roundcube too and Horde does not work with PHP 5.3 either.” “PHP 5.3 appears to break CMSMS’s CMSModule->Lang() function.”
“Zen-Cart v1.3.8a is NOT compatible with PHP 5.3.” “PHP 5.3.0 has problems with Zend encrypted files.”
Drupal: “[Some] errors are pretty easy to fix, however, there are some others where I’m not sure.”
“Joomla does not work properly under PHP 5.3. It appears to work but particularly the JHtml class is completely broken.”
Also, they added support for “goto” jumping out of loops to a labeled line. Deeper into spaghetti code!

“I recently upgraded my Production server to PHP 5.3. I’m not quite sure of the reason anymore. Whatever my original reason, after I got 5.3 installed on my server, it started slowly hemorrhaging memory and occasionally freezing up, always during the middle of the night while I slept of course.”

“Assigning the return value of new by reference is deprecated”
The “mysql_connect()” and / or “mysql_select_db()” functions are no longer reliable! They don’t always work! [one admin reported a random connection failure!]
“…most of the users cannot even dig this far and just mention that they are getting a 500 or some sort of script timeout error.”

[Almost every ISP out there may have to maintain 3 copies of PHP: v.4.3, v.5.2, and v.6, when it comes out. They are already maintaining v.4.3 along with v.5. Will they keep v.5.2 available when they … add v.5.3? PHP is starting to look like a mistake.]

A close look at PHP MySQL driver code indicates that mysql_connect() function uses mysql_real_connect() to connect to MySQL. The API mysql_real_connect() is an API which comes from MySQL dll (MySQL development team and is part of MySQL database installation). So this means the support for IPV6 in PHP MySQL driver is not possible unless there is a support for IPV6 in MySQL database. So the limitation (or no support for IPV6 or whatever word may be used to describe this situation) is coming from MySQL database limitation. So now it is clear that this is not a PHP bug in the sense that nothing can be changed in PHP code base to fix it.

A close inspection of MySQL code reveals that the function mysql_real_connect() actually tries to connect to only the first IP address returned for the hostname [localhost or 127.0.0.1] and if this fails, no further attempt to connect using other IP address associated with same host name is made. [the other one] This can be fixed and I believe a patch is already lying in some development branch of MySQL and please follow MySQL release to know which version has this fix integrated. I do not have any idea about that. But an important thing is that this bug can surface on any OS where you have above condition satisfied for the host file.

You cannot un-install 5.3 and then install 5.2 … unless …
“If you can get it through the repository,”
That sounds like a “no, ‘cos you won’t get it through the repository”

you cannot specify 5.2 vs 5.3
an, ubuntu, example of the command is
apt-get install php5 libapache2-mod-php5

If you are on an old-enough version of linux to have php 5.2 or less before upgrading to 5.3 then you could theoretically revert back, but one admin, I read about on a google search, who tried it suffered several failures and restores of his entire server before he finally “got it right”.


NOTE: the ereg… functions have been removed from PHP6 {ereg, eregi, ereg_replace, ereg_replacei }!
An “ereg is depreciated” warning is in php 5.3
“Warning. This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0.”

change ereg_replace and ereg_replacei
with
str_replace() and str_ireplace()

Be sure your error reporting is turned on: (for your testing copy or for your IP address)
@ini_set('display_errors', '1');
error_reporting(E_ALL ^ E_NOTICE);

[Instead of re-writing, the various ereg functions (in C), to make them faster, the PHP developers chose to terminate support for them, remove them in php-6, … meaning almost every ISP out there may have to maintain 3 copies of PHP: v.4.3, v.5.2, and v.6, when it comes out. They are already maintaining v.4.3 along with v.5.x]

The ill-logic of removing ereg:
As of PHP 5.3.0, the regex extension is deprecated in favor of strpos(), which is a much faster alternative to ereg() for simple strings. … use preg_match() only for complicated “regular expression” pattern matching.

Leave a Reply

We try to post all comments within 1 business day