Edit report at https://bugs.php.net/bug.php?id=70110&edit=1
ID: 70110
Updated by: cmb@php.net
Reported by: bugzilla77 at gmail dot com
Summary: preg_match problem
-Status: Analyzed
+Status: Suspended
Type: Bug
Package: PCRE related
Operating System: *
PHP Version: 7.0.0beta1
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
After some discussion on the internals list[1], the current stance
is to stick with this behavior for now, i.e. return FALSE if the
regex can't be executed due to JIT limitations, and make that info
available via preg_last_error(), see <https://3v4l.org/IWGam>.
Further improvements have to be postponed until PHP 7.1 at least,
so I'm suspending the ticket for now.
[1] <http://markmail.org/thread/6bcffpbcobyi3ln7>
Previous Comments:
------------------------------------------------------------------------
[2015-08-13 11:26:16] me at kelunik dot com
There's an even easier case that fails:
preg_match('~(a)*~', str_repeat('a', 5431), $match);
http://3v4l.org/CGSqa
------------------------------------------------------------------------
[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