#41532 [Opn->Bgs]: preg_replace replaces replacements

From: Date: Tue, 29 May 2007 20:27:02 +0000
Subject: #41532 [Opn->Bgs]: preg_replace replaces replacements
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-113164@lists.php.net to get a copy of this message
ID: 41532 Updated by: tony2001@php.net Reported By: athlan at vgroup dot pl -Status: Open +Status: Bogus Bug Type: Regexps related Operating System: Windows PHP Version: 5.2.2 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Previous Comments: ------------------------------------------------------------------------ [2007-05-29 20:12:31] athlan at vgroup dot pl Description: ------------ If you put some words to replacements, they will be replaced if there are in patterns. Reproduce code: --------------- <?php echo preg_replace(array('/test/', '/sample/'), array('replaced_test sample', 'replaced_sample'), 'test'); ?> Expected result: ---------------- replaced_test sample Actual result: -------------- replaced_test replaced_sample ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41532&edit=1

« previous php.bugs (#113164) next »