When writing a regular you may encounter with the ereg () error, such as: Deprecated: Function eregi () is deprecated ××××××××, reason is php5.3 has not supported ereg (), you can use preg_match () i parameter substitution, such as: ereg ("^[[: alnum :]]+$", $ pass); -> preg_match ("/^[[: alnum :]]+$/ i ", $ pass );
Here are details:
php 5.3 from the one speaking, it can be said in 07 years of a planned pre PHP6 version adds many features, unified a lot of grammar, so that PHP has become more powerful and concise.
Speaking of statistical framework for planning, PHP would of course be a number of aliases, repeat function are classified order, and some do not have the official removed later in php 5.3. It is not recommended for new projects continue to be used.
PHP 5.3 there are two deprecated,
E_DEPRECATED and E_USER_DEPRECATED
The following is the old project will encounter problems after php 5.3
* Define_syslog_variables
* Register_globals
* Register_long_arrays
* Safe_mode
* Magic_quotes_gpc
* Magic_quotes_runtime
* Magic_quotes_sybase
* Note in the PHP.ini is no longer recommended by #.
Deprecated functions:
* Call_user_method () can be used call_user_func () instead
* Call_user_method_array () can use call_user_func_array () instead define_syslog_variables ()
* Dl () object to load the extension using the DL, php5.3 preparation of future applications php.ini
* Ereg () can use preg_match () instead
* Ereg_replace () can use preg_replace () instead
* Eregi () with preg_match () i parameter substitution
* Eregi_replace () with preg_replace () i parameter substitution
* Set_magic_quotes_runtime () with magic_quotes_runtime () instead
* Session_register () session_unregister () session_is_registered ()
* Unified the three alternatives with $ _SESSION
* Set_socket_blocking () with stream_set_blocking () instead
* Split () by preg_split () instead
* Spliti () by preg_split () mode 'i' instead
* Sql_regcase ()
* Mysql_db_query () with the mysql_select_db () mysql_query () instead mysql_escape_string () with the use mysql_real_escape_string () instead
* The time zone handling, unified with the Timezone of like
Deprecated features:
* Add new instance of the direct return is no longer recommended. PHP 6 will no longer support
* Call-time pass-by-reference parameter is now no longer recommend the use of PHP 6 will no longer support
* Use {} to access string order is no longer recommended. Reunification with [] instead. PHP 6 will no longer support
Of course, if the project an emergency, but also to use the above method in php 5.3, you can use the following method to do
Increase in the php.ini
vim / etc / php.ini
php_flag allow_call_time_pass_reference On
php_value error_reporting "E_ALL & ~ E_NOTICE & ~ E_DEPRECATED"