ID: 41426
Updated by: [EMAIL PROTECTED]
Reported By: andreyik at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: PCRE related
Operating System: WinXP
PHP Version: 5.2.2
New Comment:
Use pcre.backtrack_limit and pcre.recursion_limit INI options.
Previous Comments:
------------------------------------------------------------------------
[2007-05-18 07:57:12] andreyik at gmail dot com
Description:
------------
negative assertions doesn't work with long text (~60000bytes) as
expected
Reproduce code:
---------------
function test($str, $cnt) {
$str = 'test "123'.str_repeat($str,$cnt).'456"';
return preg_match('#".*?(?<!\\\\)"#', $str);
}
var_dump(test('\"', 20000)); //40K
var_dump(test('\"', 30000)); //60K <--
var_dump(test('"', 100000)); //100K
Expected result:
----------------
X-Powered-By: PHP/4.4.4
Content-type: text/html
int(1)
int(1) <--
int(1)
Actual result:
--------------
X-Powered-By: PHP/5.2.0 ( and PHP/5.2.2)
Content-type: text/html
int(1)
int(0) <--
int(1)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41426&edit=1