php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33264 foreach doesn't issue error at all.
Submitted: 2005-06-07 14:18 UTC Modified: 2005-06-07 23:33 UTC
From: j_davchev at cisbg dot com Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 4.3.11 OS: Tested on linux
Private report: No CVE-ID: None
 [2005-06-07 14:18 UTC] j_davchev at cisbg dot com
Description:
------------
The foreach construct does not produce any error. It doesn't matter if variable is not defined or if variable is not an array.

error_reporting E_ALL
display_error = on


PHP manual 
"
 foreach works only on arrays, and will issue an error when you try to use it on a variable with a different data type or an uninitialized variable."

Just not so in version 4.3.11.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-07 23:33 UTC] sniper@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

see bug #31114

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 16:01:36 2024 UTC