Bug #72632 [Opn->Nab]: preg_match_all doesnt include matches longer than 2753 chars

From: Date: Wed, 20 Jul 2016 19:37:38 +0000
Subject: Bug #72632 [Opn->Nab]: preg_match_all doesnt include matches longer than 2753 chars
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202453@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72632&edit=1

 ID:                 72632
 Updated by:         cmb@php.net
 Reported by:        marcel dot wiegand at pixelgenau dot com
 Summary:            preg_match_all doesnt include matches longer than
                     2753 chars
-Status:             Open
+Status:             Not a bug
 Type:               Bug
-Package:            *Regular Expressions
+Package:            PCRE related
 Operating System:   Debian 8.5
 PHP Version:        7.0.8
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

This is not a bug, but rather a limitation of the PCRE JIT
available as of PHP 7.0.0. If you check preg_last_error() it
reports 6 what is PREG_JIT_STACKLIMIT_ERROR, see
<https://3v4l.org/kSIgr> and <https://3v4l.org/f4GLS>.

You can disable JIT with pcre.jit=0.

Related to bug #70110.


Previous Comments:
------------------------------------------------------------------------
[2016-07-20 17:34:46] marcel dot wiegand at pixelgenau dot com

Description:
------------
I tried to run a TYPO3 website on PHP 7.0.8 and noticed
that a RegEx used in their template engine behaves differently
in all PHP 7.X versions. The preg_match_all using this specific RegEx
doesn't include a match if it's longer than 2753 characters long
(until PHP 7.0.6 it was a maximum of 1414 characters). In every other
PHP Version before 7.0.0 it is working correctly.

my configure line:

./configure \
--prefix=/opt/php-7.0.8 \
--with-config-file-scan-dir=/opt/php-7.0.8/etc/conf.d \
--with-zlib-dir \
--with-freetype-dir \
--enable-mbstring \
--with-libxml-dir=/usr \
--enable-soap \
--enable-calendar \
--with-curl \
--with-mcrypt \
--with-zlib \
--with-gd \
--with-bz2 \
--with-zlib \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-pcntl \
--enable-mbregex \
--with-mhash \
--enable-zip \
--with-pcre-regex \
--with-mysql \
--with-pdo-mysql \
--with-mysqli \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--enable-gd-native-ttf \
--with-openssl \
--with-fpm-user=www-data \
--with-fpm-group=www-data \
--with-libdir=/lib/x86_64-linux-gnu \
--with-gettext \
--with-readline \
--enable-fpm \
--enable-inline-optimization \
--with-fpm-systemd

I have used the shipped php.ini-production

Test script:
---------------
1415 characters match:
https://3v4l.org/IQaph

2754 characters match:
https://3v4l.org/m39jl



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=72632&edit=1


Thread (2 messages)

« previous php.bugs (#202453) next »