|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-02-18 11:46 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 02:00:02 2025 UTC |
Description: ------------ It looks as if when PHP is doing preg_replace and there are a lot of () values, then it just dies With my example code, it'll die when doing preg_replace I've tried a few values of $regexp on line 2 /<(.|\n)*>/ - it dies /<(.)*>/ - it dies /<.*>/ - it works fine If the $test string is 1844 characters long it works fine, if it's 1845 characters long it dies. It doesn't matter whether the string actually matches or not, it's the number of characters it's trying to match. The problem doesn't seem to happen with preg_match Reproduce code: --------------- <?php $regexp = "/<(.|\n)*>/"; $stringlength = 1845; echo "test start \n"; $test = '<' . str_repeat('x', $stringlength - 1); $test = preg_replace($regexp,"",$test); echo "test done\n"; ?> Expected result: ---------------- test start test done Actual result: -------------- <nothing>