Bug #53955 [NEW]: preg_match_all missing results

From: Date: Tue, 08 Feb 2011 08:06:08 +0000
Subject: Bug #53955 [NEW]: preg_match_all missing results
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-158576@lists.php.net to get a copy of this message
From: Operating system: FreeBSD 7.2-RELEASE PHP version: 5.3.5 Package: *Regular Expressions Bug Type: Bug Bug description:preg_match_all missing results Description: ------------ phpinfo(); http://corgfx.com/info.php preg_match_all is missing valid results while running in a loop of documents. There are 12 valid matches per document, but starting from document 5 only 11 results are returned. When the script is run "only" on document 5 or 6 or 7 etc, all 12 results are returned properly. The script returns no warnings or errors when running in the loop and missing the 12th result. Test script: --------------- This is an example of the code being used: for ($i = 0; $i <= $pages; $i++) { shell_exec(" /usr/local/bin/curl -o /tmp/coffee_process_ajax.tmp -b PHPSESSID=$cookie -d \"category_id=$cat&page_index=$i\" http://www..........com/html/results_ajax.php"); $filename = "/tmp/coffee_process_ajax.tmp"; $handle = fopen($filename, "r"); $adata = fread($handle, filesize($filename)); fclose($handle); preg_match_all("/<table class=AssetContent>(.*?)<\/table>/", str_replace("\n","",$adata), $ajarray); $saveThis[]=$ajarray[0]; } Expected result: ---------------- The expected result is all 12 results to be returned with and without the loop. Actual result: -------------- Returns only 11 results starting at $page=4 (the 5th document) while running in the loop. Returns all 12 results for $page=4 when not running in the loop. -- Edit bug report at http://bugs.php.net/bug.php?id=53955&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53955&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53955&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53955&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53955&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53955&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53955&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53955&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53955&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53955&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53955&r=support Expected behavior: http://bugs.php.net/fix.php?id=53955&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53955&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53955&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53955&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53955&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53955&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53955&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53955&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53955&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53955&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53955&r=mysqlcfg

« previous php.bugs (#158576) next »