Bug #11070 Updated: '@' does not turn off error checking in foreach()
| From: | cnewbill@php.net | Date: | Wed, 23 May 2001 22:52:59 +0000 |
| Subject: | Bug #11070 Updated: '@' does not turn off error checking in foreach() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-56557@lists.php.net to get a copy of this message | ||
ID: 11070
Updated by: cnewbill
Reported By: lee@mediawaveonline.com
Status: Open
Bug Type: Feature/Change Request
Operating system:
PHP Version: 4.0.5
Assigned To:
Comments:
Use....
if (is_array($a))
foreach ($a as $key => $val) {
/* Do something */
}
....until it is added, which it may not be.
-Chris
Previous Comments:
---------------------------------------------------------------------------
[2001-05-23 18:47:32] lee@mediawaveonline.com
it would be nice to see the '@' turn off error reporting on the foreach() command. ie.
<?php
foreach($test as $pos => $val)
{
}
?>
gives an error because $test is not set.
<?php
foreach(@$test as $pos => $val)
{
}
?>
gives an error because its the wrong data type.
<?php
@foreach($test as $pos => $val)
{
}
?>
gives a syntax error. it would be nice if this last command worked :)
Chris Lee
lee@mediawaveonline.com
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11070&edit=2