Added and clarified function alternatives relating to the deprecation of the regex extension.

Contribution by Ole Aass.
Relates to and closes bug #63934.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@329092 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Justin Martin 2013-01-12 03:54:14 +00:00
parent f9a6276cf2
commit d895a58b2a
6 changed files with 26 additions and 11 deletions

View file

@ -140,9 +140,8 @@ $text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",
&note.regex.deprecated;
<tip>
<para>
<function>preg_replace</function>, which uses a Perl-compatible
regular expression syntax, is often a faster alternative to
<function>ereg_replace</function>.
<function>ereg_replace</function> is deprecated as of PHP 5.3.0. <function>preg_replace</function>
is the suggested alternative to this function.
</para>
</tip>
</refsect1>

View file

@ -133,13 +133,12 @@ if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $date, $regs)) {
<refsect1 role="notes">
&reftitle.notes;
&note.regex.deprecated;
<note>
<tip>
<para>
<function>preg_match</function>, which uses a Perl-compatible
regular expression syntax, is often a faster alternative to
<function>ereg</function>.
<function>ereg</function> is deprecated as of PHP 5.3.0. <function>preg_match</function>
is the suggested alternative to this function.
</para>
</note>
</tip>
</refsect1>
<refsect1 role="seealso">

View file

@ -89,6 +89,12 @@ $body = eregi_replace($pattern, $replacement, $body);
<refsect1 role="notes">
&reftitle.notes;
&note.regex.deprecated;
<tip>
<para>
<function>eregi_replace</function> is deprecated as of PHP 5.3.0. <function>preg_replace</function>
with the <literal>i</literal> (<constant>PCRE_CASELESS</constant>) modifier is the suggested alternative.
</para>
</tip>
</refsect1>
<refsect1 role="seealso">

View file

@ -97,6 +97,12 @@ if (eregi('z', $string)) {
<refsect1 role="notes">
&reftitle.notes;
&note.regex.deprecated;
<tip>
<para>
<function>eregi</function> is deprecated as of PHP 5.3.0. <function>preg_match</function>
with the <literal>i</literal> (<constant>PCRE_CASELESS</constant>) modifier is the suggested alternative.
</para>
</tip>
</refsect1>
<refsect1 role="seealso">

View file

@ -127,9 +127,8 @@ echo "Month: $month; Day: $day; Year: $year<br />\n";
&note.regex.deprecated;
<tip>
<para>
<function>preg_split</function>, which uses a Perl-compatible regular
expression syntax, is often a faster alternative to
<function>split</function>. If you don't require the power of regular
<function>split</function> is deprecated as of PHP 5.3.0. <function>preg_split</function>
is the suggested alternative to this function. If you don't require the power of regular
expressions, it is faster to use <function>explode</function>, which
doesn't incur the overhead of the regular expression engine.
</para>

View file

@ -122,6 +122,12 @@ Array
<refsect1 role="notes">
&reftitle.notes;
&note.regex.deprecated;
<tip>
<para>
<function>spliti</function> is deprecated as of PHP 5.3.0. <function>preg_split</function>
with the <literal>i</literal> (<constant>PCRE_CASELESS</constant>) modifier is the suggested alternative.
</para>
</tip>
</refsect1>
<refsect1 role="seealso">