|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-01-27 15:00 UTC] richard at roguewavelimited dot com
-PHP Version: 5.3.5
+PHP Version: 5.3.3
[2011-01-27 15:00 UTC] richard at roguewavelimited dot com
[2011-01-27 15:07 UTC] salathe@php.net
-Status: Open
+Status: Bogus
[2011-01-27 15:07 UTC] salathe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 15:00:02 2025 UTC |
Description: ------------ The preg_replace is doing a double replacement when the parenthesized pattern is the whole string. Test script: --------------- define ('EOL', "\n"); $patterns = '|(.*)|'; $replacements = '$1-new'; $line = 'OLD'; $line = @preg_replace($patterns, $replacements, $line, -1, $changes); print $line . EOL; Expected result: ---------------- 'OLD-new' Actual result: -------------- 'OLD-new-new'