php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41426 problems with prce assertions
Submitted: 2007-05-18 07:57 UTC Modified: 2007-05-18 11:58 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: andreyik at gmail dot com Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 5.2.2 OS: WinXP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: andreyik at gmail dot com
New email:
PHP Version: OS:

 

 [2007-05-18 07:57 UTC] 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)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-18 11:58 UTC] tony2001@php.net
Use pcre.backtrack_limit and pcre.recursion_limit INI options.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC