Re: PHP 4.0 Bug #5408: foreach() should silently ignore non-array's passed to it
| From: | Daniel Beckham | Date: | Wed, 05 Jul 2000 16:21:31 +0000 |
| Subject: | Re: PHP 4.0 Bug #5408: foreach() should silently ignore non-array's passed to it | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-23613@lists.php.net to get a copy of this message | ||
At 05:59 PM 07/05/2000 +0200, you wrote:
foreach is a statement not a function so you can't use @.Right... it was a wishlist item.
Otherwise, I have to continually use is_array() before using foreach() just to make sure my script continues to live. PHP scripts don't die when they encounter E_WARNINGs.True.. for some reason I was thinking that they did. But the warning is still very ugly.
Write yourself an error_handler which ignores foreach warnings:Great.. didn't realize I could do this. Thanks. Daniel