Edit report at https://bugs.php.net/bug.php?id=63651&edit=1

 ID:                 63651
 Updated by:         ni...@php.net
 Reported by:        magog dot the dot ogre at gmail dot com
 Summary:            preg_replace() returns null for very long string
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            PCRE related
 Operating System:   Windows, Unix
 PHP Version:        5.3.19
 Block user comment: N
 Private report:     N

 New Comment:

In particular this part of the regex seems odd: \s*?)\s*\s* Three 
asterix-quantifier on the same thing in a row, that's something that can easily 
blow up a regular expression ;)


Previous Comments:
------------------------------------------------------------------------
[2012-12-04 01:04:38] mail+php at requinix dot net

You're hitting the backtrack limit defined as the pcre.backtrack_limit setting. 
If 
I up mine to 10000000 (10e6) I get a string(80) "Hello worldHello world..."

Simply put, your regex is too inefficient to work on that $text.

------------------------------------------------------------------------
[2012-11-30 01:46:45] magog dot the dot ogre at gmail dot com

Description:
------------
I have tested and gotten this error on the following two distros:
*5.3.19 for Windows
*5.3.8 for SunOS

Run the code at the pastebin link I've provided. You will see that PHP is 
returning null in a preg_replace function! It occurs in both Windows and Unix. 
I 
do not know if this is a PHP problem, or a PCRE problem.

Test script:
---------------
http://pastebin.com/PBCDexXH



Expected result:
----------------
A string should be outputted

Actual result:
--------------
Instead, a NULL result is outputted.


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



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

Reply via email to