Bug #77827 [NEW]: preg_match throws error on valid expression

From: Date: Sat, 30 Mar 2019 17:49:26 +0000
Subject: Bug #77827 [NEW]: preg_match throws error on valid expression
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220254@lists.php.net to get a copy of this message
From: peehaa Operating system: Windows PHP version: 7.3.3 Package: PCRE related Bug Type: Bug Bug description:preg_match throws error on valid expression Description: ------------ When running the repro script on my machine I am hitting two issues: 1. preg_match is unable to handle my valid expression 2. it outputs a broken error message This only happens on my (Windows) machine. On 3v4l (https://3v4l.org/hdiM4) it's working like it should. Test script: --------------- <?php $pattern = ' ~^ (?: (?:(?P<function>function)\s*\(\s* (?:(?P<table1>.+)(?:\.))?(?P<column1>[^ ]+) \s*\)) | (?:(?P<table2>.+)(?:\.))?(?P<column2>[^ ]+) ) (?:\s+as\s+(?P<alias>.+))? $~ix '; var_dump(PCRE_VERSION); var_dump(preg_match($pattern, 'id')); var_dump(preg_last_error()); Expected result: ---------------- string(16) "10.32 2018-09-10" int(1) int(0) Actual result: -------------- string(16) "10.32 2018-09-10" ' in \path\to\php-bug.php on line 17 bool(false) int(1) -- Edit bug report at https://bugs.php.net/bug.php?id=77827&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77827&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77827&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77827&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=77827&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=77827&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=77827&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=77827&r=needscript Try newer version: https://bugs.php.net/fix.php?id=77827&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=77827&r=support Expected behavior: https://bugs.php.net/fix.php?id=77827&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=77827&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=77827&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=77827&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77827&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=77827&r=dst IIS Stability: https://bugs.php.net/fix.php?id=77827&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=77827&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=77827&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=77827&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=77827&r=mysqlcfg

« previous php.bugs (#220254) next »