HomeCoding & Programming

Deprecated features in PHP 5.3.x or later

Like Tweet Pin it Share Share Email

PHP 5.3.0 introduces two new error levels named as E_DEPRECATED and E_USER_DEPRECATED.

 

The E_DEPRECATED error level is used to indicate that a function or feature has been deprecated.

 

The E_USER_DEPRECATED level is intended for indicating deprecated features in user code, similarly to the E_USER_ERROR and E_USER_WARNING levels.

 

The following is a list of deprecated INI directives.
Use of any of these INI directives will cause an E_DEPRECATED.

define_syslog_variables
register_globals
register_long_arrays
safe_mode
magic_quotes_gpc
magic_quotes_runtime
magic_quotes_sybase
Comments starting with ‘#’ are now deprecated in .INI files.

 

Deprecated functions:

1.call_user_method()
  Can be used call_user_func() instead

2.call_user_method_array()
  Can be used call_user_func_array() instead

3.define_syslog_variables()
  dl()

4.ereg()
  Can be used preg_match() instead

5.ereg_replace()
  Can be used preg_replace() instead

6.eregi()
  Can be used preg_match() with the 'i' modifier instead

7.eregi_replace()
  Can be used preg_replace() with the 'i' modifier instead

8.set_magic_quotes_runtime() and its alias, magic_quotes_runtime()

9.session_register()
  Can be used the $_SESSION superglobal instead

10.session_unregister()
  Can be used the $_SESSION superglobal instead

11.session_is_registered()
  Can be used the $_SESSION superglobal instead

12.set_socket_blocking()
  Can be used stream_set_blocking() instead

13.split()
  Can be used preg_split() instead

14.spliti()
  Can be used preg_split() with the 'i' modifier instead

15.sql_regcase()

16.mysql_db_query()
  Can be used mysql_select_db() and mysql_query() instead

17.mysql_escape_string()
  Can be used mysql_real_escape_string() instead

18.Passing locale category names as strings is now deprecated. Use the LC_* family of constants instead.
  The is_dst parameter to mktime(). Use the new timezone handling functions instead.

 

Deprecated features:

       * Assigning the return value of new by reference is now deprecated.

       * Call-time pass-by-reference is now deprecated.

 

Deprecated variables:

HTTP_ENV_VARS  use $_ENV instead
HTTP_GET_VARS  use $_GET instead
HTTP_POST_VARS  use $_POST instead
HTTP_POST_FILES  use $_FILE instead
HTTP_COOKIE_VARS  use $_COOKIE instead
HTTP_SESSION_VARS  use $_SESSION instead

 

You should take care the above in the coding, so that the code will run new in versions of PHP also.

If you have some more in this list, Please share with scriptarticle.com with comments.

 

Comments (1)

  • Thanks a lot for sharing such a great information.I like your articles.Keep it up,thanks again.

Comments are closed.