|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #11070 '@' does not turn off error checking in foreach()
Submitted: 2001-05-23 18:47 UTC Modified: 2001-08-28 04:19 UTC
From: lee at mediawaveonline dot com Assigned:
Status: Duplicate Package: Feature/Change Request
PHP Version: 4.0.5 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: lee at mediawaveonline dot com
New email:
PHP Version: OS:


 [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.

  foreach($test as $pos => $val)

gives an error because $test is not set.

  foreach(@$test as $pos => $val)

gives an error because its the wrong data type.

  @foreach($test as $pos => $val)

gives a syntax error. it would be nice if this last command worked :)

  Chris Lee


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-23 18:52 UTC]

if (is_array($a))
    foreach ($a as $key => $val) {
        /* Do something */

....until it is added, which it may not be.

 [2001-08-28 04:19 UTC]
Duplicate of 6118.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Oct 03 05:05:53 2022 UTC