Bug #70110 [Com]: preg_match problem
| From: | me at kelunik dot com | Date: | Thu, 13 Aug 2015 11:26:18 +0000 |
| Subject: | Bug #70110 [Com]: preg_match problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-195182@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70110&edit=1
ID: 70110
Comment by: me at kelunik dot com
Reported by: bugzilla77 at gmail dot com
Summary: preg_match problem
Status: Analyzed
Type: Bug
Package: PCRE related
Operating System: *
PHP Version: 7.0.0beta1
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
There's an even easier case that fails:
preg_match('~(a)*~', str_repeat('a', 5431), $match);
http://3v4l.org/CGSqa
Previous Comments:
------------------------------------------------------------------------
[2015-07-23 10:16:10] cmb@php.net
No, not a bug in libpcre. PHP has to cater to PCRE_ERROR_JIT_STACKLIMIT.
------------------------------------------------------------------------
[2015-07-22 14:03:30] cmb@php.net
Well, that appears to be a bug in libpcre. I've filed a respective
report[1], and suspend this ticket for now.
[1] <https://bugs.exim.org/show_bug.cgi?id=1663>
------------------------------------------------------------------------
[2015-07-22 12:05:15] cmb@php.net
That's related to the PCRE-JIT compilation which is available as
of PHP 7. When pcre.jit=0 it works as expected.
------------------------------------------------------------------------
[2015-07-22 09:04:53] bugzilla77 at gmail dot com
Description:
------------
Regresion (PHP 5.6.11 no bugy)
Test script:
---------------
<?php
var_dump(preg_match('/^(A{1,2}B)+$/',str_repeat('AB',8192)));
?>
Expected result:
----------------
int(1)
Actual result:
--------------
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70110&edit=1