#50256 [Opn->Bgs]: preg_replace with e modifier quotes parsing

From: Date: Sat, 21 Nov 2009 14:59:46 +0000
Subject: #50256 [Opn->Bgs]: preg_replace with e modifier quotes parsing
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-144907@lists.php.net to get a copy of this message
ID: 50256 Updated by: jani@php.net Reported By: janturon at email dot cz -Status: Open +Status: Bogus Bug Type: PCRE related Operating System: Win 2000 PHP Version: 5.3.1 New Comment: Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. Please search the bug database before you submit yet another bogus report. Previous Comments: ------------------------------------------------------------------------ [2009-11-21 11:03:27] janturon at email dot cz Description: ------------ preg_replace with e modifier handles quotes bad (might be related to bug #32985) Reproduce code: --------------- function func($str) { return '"'.$str.'"'; } echo preg_replace("/(.*)/e","func('\\1')","foo"); Expected result: ---------------- "foo" Actual result: -------------- "foo""" In PHP 5.2.9 (Win XP), this result was produced (bug #32985) \"foo\" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50256&edit=1

« previous php.bugs (#144907) next »