From: baroiller at aoditu dot com Operating system: linux redhat 7.2 PHP version: 4.4.1RC1 PHP Bug Type: *General Issues Bug description: scripts hangs on netx() prev()
Description: ------------ Many "open source" softwares like phpadsnew, and squiremail ( i've got problems on theses ), hangs. after looking into their code, i've found that all fuctions reset(), next(), prev() hangs when passed value is'nt an array. Reproduce code: --------------- code sample (all latest versions) : // phpAdsNew if (phpAds_isUser(phpAds_Admin)) $pages[] = $phpAds_nav['admin']; elseif (phpAds_isUser(phpAds_Client)) $pages[] = $phpAds_nav['client']; elseif (phpAds_isUser(phpAds_Affiliate)) $pages[] = $phpAds_nav['affiliate']; else $pages = array(); for (reset($pages);$key=key($pages);next($pages)) { //// .... //// } // squireMail if (is_array($msort)) { for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) { //// ... //// } Actual result: -------------- added $pages = array() for phpadsnew ( bug fixed ) but, put code into comments onto squiremail ( don't have any time...) -- Edit bug report at http://bugs.php.net/?id=35067&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35067&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=35067&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=35067&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=35067&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=35067&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=35067&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=35067&r=needscript Try newer version: http://bugs.php.net/fix.php?id=35067&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=35067&r=support Expected behavior: http://bugs.php.net/fix.php?id=35067&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=35067&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=35067&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=35067&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35067&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=35067&r=dst IIS Stability: http://bugs.php.net/fix.php?id=35067&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=35067&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=35067&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=35067&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=35067&r=mysqlcfg