ID:               48047
 Updated by:       scott...@php.net
 Reported By:      goriol at technema dot fr
-Status:           Open
+Status:           Bogus
 Bug Type:         *Regular Expressions
 Operating System: Windows XP
 PHP Version:      5.2.9
 New Comment:

preg_last_error() returns 2 which is PREG_BACKTRACK_LIMIT_ERROR.


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

[2009-04-22 13:53:16] goriol at technema dot fr

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


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


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

Reply via email to