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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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: Tue Apr 30 04:01:30 2024 UTC