From: zpiranha at piranhaweb dot xgt dot us Operating system: Redhat 7.3 PHP version: 4.3.7 PHP Bug Type: Arrays related Bug description: foreach() does not work when glob() returns false
Description: ------------ When using PHP 4.3.7, foreach() will produce error messages when glob() returns false. However, it will still function. The error message is very unsightly. Download the script in question from http://piranhaweb.xgt.us/dl/zChat_1.4.zip Note: The script works perfectly fine in previous versions of PHP. Reproduce code: --------------- http://www.familytables.net/chat Expected result: ---------------- In the right-hand frame, where the error is mostly occuring, you will see (assuming nobody is in the chat room): x Active Users INVALID ARGUMENT FOR FOREACH() ERROR name (y) name (y) ... Actual result: -------------- 1 Active Users Error: Invalid argument supplied for foreach() in online.php -- Edit bug report at http://bugs.php.net/?id=28998&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28998&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28998&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=28998&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=28998&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=28998&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=28998&r=needscript Try newer version: http://bugs.php.net/fix.php?id=28998&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=28998&r=support Expected behavior: http://bugs.php.net/fix.php?id=28998&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=28998&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=28998&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=28998&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28998&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=28998&r=dst IIS Stability: http://bugs.php.net/fix.php?id=28998&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=28998&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=28998&r=float