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
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:
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.