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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
17 - 14 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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 Apr 16 12:01:29 2024 UTC