downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Undeprecated features in PHP 5.3.x> <Changes in SAPI modules
Last updated: Fri, 20 Nov 2009

view this page in

Deprecated features in PHP 5.3.x

PHP 5.3.0 introduces two new error levels: 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 error to be thrown at startup.

Deprecated functions:

Deprecated features:

  • Assigning the return value of new by reference is now deprecated.
  • Call-time pass-by-reference is now deprecated.
  • The use of {} to access string offsets is deprecated. Use [] instead.


add a note add a note User Contributed Notes
Deprecated features in PHP 5.3.x
Chris at PureFormSolutions dot com
01-Jul-2009 01:57
To find [and replace] string access offsets using {}, like:
<?php
    $var
= "abcd";
    echo
$var{1};
?>

I plugged this regex into my IDE [NuSphere]:

\$([a-zA-Z0-9_]+){([^}]+)}

... and put this as the replacement string:

$\1[\2]

This helped me find all the instances of this in my code, but it might not find all of them in yours. It will ignore stuff like:
<?php
    $var_1
= "abcd";
   
$i = 1;
    echo ${
'var_' . $i}{1}; # this will not be found by the regex above
?>

 
show source | credits | stats | sitemap | contact | advertising | mirror sites