PHP 4.0 Bug #5408: foreach() should silently ignore non-array's passed to it
| From: | danbeck at dealnews dot com | Date: | Thu, 06 Jul 2000 15:35:43 +0000 |
| Subject: | PHP 4.0 Bug #5408: foreach() should silently ignore non-array's passed to it | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-23603@lists.php.net to get a copy of this message | ||
From: danbeck@dealnews.com
Operating system: Redhat 6.1 (Linux 2.2.12-20)
PHP version: 4.0 Latest CVS (06/07/2000)
PHP Bug Type: Feature/Change Request
Bug description: foreach() should silently ignore non-array's passed to it
I feel foreach() should silently ingore any non-array variables passed to it, especially if this was
modeled after the same Perl statement. At the very least, I would like to be able to use the @
notation in front of it so that the script won't die if it doesn't get it's array.
Otherwise, I have to continually use is_array() before using foreach() just to make sure my script
continues to live. Since PHP doesn't make you delcare or initialize variables, you can't
always expect that the variables you give a statement or function will be what they are supposed to
me.
I know that I can just turn my error reporting down, but I do want to see other valid script and
parse errors.
Thanks,
Daniel Beckham