From: stronk7 at moodle dot org Operating system: potentially any PHP version: 5.2.4 PHP Bug Type: PCRE related Bug description: preg_match_all doesn't capture more than 99998 bytes
Description: ------------ Trying to capture more than 99998 bytes from one string captures nothing. Same behavior happens also in other PCRE functions. You can see more test results in the original place where was reported: http://tracker.moodle.org/browse/MDL-11237 Reproduce code: --------------- <?php /// Change this if you want, but 99999 is the limit in my system (Darwin mbp 8.10.1) $numchars = 99999; /// Test begins here echo 'PHP: ' . phpversion() . '<br />'; echo 'OS: ' . php_uname() . '<br />'; $all = ''; for($i=0; $i<$numchars-2; $i++) { $all .= 'x'; } $all = '@' . $all . '@'; preg_match_all('/@(.*?)@/is', $all, $results); if ($results[0]) { echo 'OK, preg_match_all() has been able to capture one text of ' . strlen($results[0][0]) . ' bytes.<br />'; } else { echo 'ERROR, preg_match_all() has NOT been able to capture one text of ' . strlen($all) . ' bytes.<br />'; } ?> Expected result: ---------------- It should show: OK, preg_match_all() has been able to capture one text of 99999 bytes Actual result: -------------- ERROR, preg_match_all() has NOT been able to capture one text of 99999 bytes -- Edit bug report at http://bugs.php.net/?id=42649&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42649&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42649&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42649&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42649&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42649&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42649&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42649&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42649&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42649&r=support Expected behavior: http://bugs.php.net/fix.php?id=42649&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42649&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42649&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42649&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42649&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42649&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42649&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42649&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42649&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42649&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42649&r=mysqlcfg