Doc #70328 [NEW]: wrong value of the maximum number of captured substrings in Subpatterns

From: Date: Sat, 22 Aug 2015 17:43:30 +0000
Subject: Doc #70328 [NEW]: wrong value of the maximum number of captured substrings in Subpatterns
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-12639@lists.php.net to get a copy of this message
From: jhdxr Operating system: win10 PHP version: 5.6.12 Package: Documentation problem Bug Type: Documentation Problem Bug description:wrong value of the maximum number of captured substrings in Subpatterns Description: ------------ As reported in #67576 , the doc says "The maximum number of captured substrings is 65535. ". However, the test script failed. It raised a warning: > Warning: preg_match(): Compilation failed: regular expression is too large at offset 21000 and followed by the instructions in #67576 , if I edit 7000 to 6552, everything works. So is it a documentation problem or I misunderstand something? Test script: --------------- <?php ini_set("pcre.backtrack_limit", -1); ini_set("pcre.recursion_limit", -1); $test2 = str_repeat('a',10000); //7000 is much smaller than 65535 if (preg_match('/'.str_repeat('(a)',7000).'/', $test2, $regs2)) { var_dump($regs2); } else { echo 'Not find'; } Expected result: ---------------- output the results of preg_match Actual result: -------------- Warning: preg_match(): Compilation failed: regular expression is too large at offset 21000 -- Edit bug report at https://bugs.php.net/bug.php?id=70328&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70328&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70328&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70328&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=70328&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=70328&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=70328&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=70328&r=needscript Try newer version: https://bugs.php.net/fix.php?id=70328&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=70328&r=support Expected behavior: https://bugs.php.net/fix.php?id=70328&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=70328&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=70328&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=70328&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70328&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=70328&r=dst IIS Stability: https://bugs.php.net/fix.php?id=70328&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=70328&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=70328&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=70328&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=70328&r=mysqlcfg

« previous php.doc.bugs (#12639) next »