#41426 [Opn->Bgs]: problems with prce assertions
| From: | tony2001@php.net | Date: | Fri, 18 May 2007 11:58:24 +0000 |
| Subject: | #41426 [Opn->Bgs]: problems with prce assertions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-112820@lists.php.net to get a copy of this message | ||
ID: 41426
Updated by: tony2001@php.net
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