|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-08-26 22:14 UTC] jani@php.net
[2008-08-27 00:18 UTC] xxorax at gmail dot com
[2008-08-27 00:22 UTC] felipe@php.net
[2008-08-27 03:24 UTC] xxorax at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 05:00:01 2025 UTC |
Description: ------------ strange bug, this code skip all characters expect the end \n (\r is find). This is the same when .*? is in subpattern. Reproduce code: --------------- $str = "test\ntest\r\n"; function v($s) { echo '"'.$s.'"'."\n---\n"; } echo v(preg_replace('#^.*$#s','', $str)); echo v(preg_replace('#^.*?$#s','', $str)); echo v(preg_replace('#^.*$#Us','', $str)); Expected result: ---------------- "" --- "" --- "" --- Actual result: -------------- "" --- " " --- " " ---