PHP 5.3: welcome to release party in Munich

Today we continue our analysis of the most significant changes applied to the new PHP version.

Changing magic methods

Before the introduction of PHP 5.3, these methods could be marked not only as public but also as private, protected, static ones, etc. Starting with the 5.3 these methods (mentioned below) cannot be static and must be public only:

* __get ()
* __set ()
* __isset ()
* __unset ()
* __call ()

Ministry of Health warns

PHP has a list of functions that were marked for removal. Most of them are not common (PHP developers use them not very often), but nevertheless, you should check your code (they won’t work in the new version). These functions are:

* Call_user_method ()
* Call_user_method_array ()
* Define_syslog_variables ()
* Ereg ()
* Ereg_replace ()
* Eregi ()
* Eregi_replace ()
* Set_magic_quotes_runtime () / magic_quotes_runtime ()
* Session_register ()
* Session_unregister ()
* Session_is_registered ()
* Set_socket_blocking ()
* Split ()
* Spliti ()
* Sql_regcase ()

Moreover, some directives in PHP.INI suffer the same fate, now they will warn you (E_DEPRECATED) if you try to activate them:

* Define_syslog_variables
* Register_globals
* Register_long_arrays
* Safe_mode
* Magic_quotes_gpc
* Magic_quotes_runtime
* Magic_quotes_sybase

Surprises

In PHP 5.0, the method “is_a ()” was described as inadvisable (manuals recommended to use “instanceof”), but in spite of this fact “is_a ()” was not removed from the language. Furthermore now it works without E_DEPRECATED-warnings.

The following words were reserved:

* GOTO
* NAMESPACE

It is very unlikely that they were included in your code, however, it would be better for you to scan the code. These words cannot be used as function names, class names, etc.

Leave a Reply

Spam protection by WP Captcha-Free