ID:               27310
 Updated by:       [EMAIL PROTECTED]
 Reported By:      paul at pscs dot co dot uk
-Status:           Open
+Status:           Bogus
 Bug Type:         Reproducible crash
 Operating System: Win32 (Windows XP)
 PHP Version:      4.3.5RC3
 New Comment:

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Try searching the bug db before submiting YET another report about same
issue. (and it's PCRE limitation, not bug)




Previous Comments:
------------------------------------------------------------------------

[2004-02-18 09:03:59] paul at pscs dot co dot uk

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>


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27310&edit=1

Reply via email to