ID:               39695
 Updated by:       [EMAIL PROTECTED]
 Reported By:      ivo_gelov at abv dot bg
-Status:           Open
+Status:           Feedback
 Bug Type:         PCRE related
 Operating System: Linux Fedora Core 4
 PHP Version:      5.2.0
 New Comment:

Not reproducible.
Btw, this code - $rep = '\$2\$1'; apparently won't work.


Previous Comments:
------------------------------------------------------------------------

[2006-11-30 16:55:02] ivo_gelov at abv dot bg

Description:
------------
There are 2 strange effects/bugs, may be one depends on the other, I do
not know.
1. PREG_REPLACE does not recognize $n as a back reference in its second
argument. It will recognize only \\n references.
2. PREG_REPLACE returns NULL if no match is found, instead of returning
unmodified subject

This symptom is present only in 5.2.0 - there are no problems with
5.1.0

Reproduce code:
---------------
$pat = '/^([a-zA-Z])(\d*)$/';
$rep = '\$2\$1';
$b = preg_replace($pat,$rep,'D764209812');


Expected result:
----------------
$b should be '764209812D'

Actual result:
--------------
$b is NULL


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=39695&edit=1

Reply via email to