Bug #74675 [NEW]: Regex that worked fine on 5.x Fails Randomly on 7.x
| From: | donatj at gmail dot com | Date: | Tue, 30 May 2017 20:14:57 +0000 |
| Subject: | Bug #74675 [NEW]: Regex that worked fine on 5.x Fails Randomly on 7.x | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-209304@lists.php.net to get a copy of this message | ||
From: donatj at gmail dot com
Operating system: Darwin / Linux
PHP version: 7.1.5
Package: PCRE related
Bug Type: Bug
Bug description:Regex that worked fine on 5.x Fails Randomly on 7.x
Description:
------------
We use this regex (?(?=")"(\\"|[^"])*"|'(\\'|[^'])*')
as part of our
internal CI system as a step to clear strings.
We were getting weird failures on 7.x builds and I hunted it down to the
fact that this regex randomly fails on some strings in 7.x. It works in
most cases, but we have 4 files where it randomly fails and returns
NULL.
It's worked fine prior in 5.x for years, and works on HHVM fine so
something must have changed in PHP7.
Test script:
---------------
The issue can be seen here. https://3v4l.org/SEWZc /
https://gist.github.com/donatj/b872de5cc8f755871500a82c483aa92f
I boiled the input string down as much as I could manage, it's still
very long.
--
Edit bug report at https://bugs.php.net/bug.php?id=74675&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74675&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74675&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74675&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74675&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74675&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74675&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74675&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74675&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74675&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74675&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74675&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74675&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74675&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74675&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74675&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74675&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74675&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74675&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74675&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74675&r=mysqlcfg