|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-04-22 13:58 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 22:00:01 2025 UTC |
Description: ------------ I found a situation where preg_replace returns NULL instead of the expected string. The regexp I use is (perhaps) erroneous: "/^\s*(.*?)\s*$/s" But when the string size is less than 49997 characters, the function returns the string properly. Over that size, the function returns NULL. Reproduce code: --------------- $a = str_repeat('a', 49998); $a = preg_replace('/^\s*(.*?)\s*$/s', '$1', $a); Expected result: ---------------- $a Actual result: -------------- NULL