php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72632 preg_match_all doesnt include matches longer than 2753 chars
Submitted: 2016-07-20 17:34 UTC Modified: 2016-07-20 19:37 UTC
From: marcel dot wiegand at pixelgenau dot com Assigned: cmb (profile)
Status: Not a bug Package: PCRE related
PHP Version: 7.0.8 OS: Debian 8.5
Private report: No CVE-ID: None
 [2016-07-20 17:34 UTC] 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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-20 19:37 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Package: *Regular Expressions +Package: PCRE related -Assigned To: +Assigned To: cmb
 [2016-07-20 19:37 UTC] cmb@php.net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC