|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-05-31 12:43 UTC] sniper@php.net
[2005-05-31 12:49 UTC] astax_t at gorodok dot net
[2005-05-31 12:53 UTC] astax_t at gorodok dot net
[2005-05-31 14:13 UTC] sniper@php.net
[2005-05-31 14:56 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 22:00:01 2025 UTC |
Description: ------------ When magic_quotes_sybase is On, this also affects how apostrophes are escaped in preg_replace with /e modifier. See example. In example code I specifically included a string with $ inside to point why it's impossible to use double quotes around \\1 in second parameter. Reproduce code: --------------- $str = 'some \'$sample\' text'; $str = preg_replace("/(some.*text)/e", "strtoupper('\\1')", $str); echo $str; Expected result: ---------------- SOME '$SAMPLE' TEXT Actual result: -------------- Parse error: parse error in E:\test\web\a.php(4) : regexp code on line 1 Fatal error: preg_replace(): Failed evaluating code: strtoupper('some ''$sample'' text') in E:\test\web\a.php on line 4