From cce3db21a11236d935dc93d601897302a8e7afe8 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Sun, 11 Feb 2007 19:48:34 +0000 Subject: [PATCH] fix bug #40395: document which chars are escaped when running with '/e' modifier git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@229572 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/pcre/functions/preg-replace.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/reference/pcre/functions/preg-replace.xml b/reference/pcre/functions/preg-replace.xml index 47849dd742..0ef9f6a748 100644 --- a/reference/pcre/functions/preg-replace.xml +++ b/reference/pcre/functions/preg-replace.xml @@ -1,5 +1,5 @@ - + preg_replace @@ -83,6 +83,17 @@ $1 backreference, leaving the 1 as a literal. + + When using the e modifier, this function escapes + some characters (namely ', ", + \ and NULL) in the strings that replace the + backreferences. This is done to ensure that no syntax errors arrise + from backreference usage with either single or double quotes (e.g. + 'strlen(\'$1\')+strlen("$2")'). Make sure you are + aware of PHP's string + syntax to know exactly how the interpreted string will look + like. +