|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-05-23 18:47 UTC] lee at mediawaveonline dot 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 09:00:01 2025 UTC |
Use.... if (is_array($a)) foreach ($a as $key => $val) { /* Do something */ } ....until it is added, which it may not be. -Chris