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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: j_davchev at cisbg dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 29 19:00:02 2025 UTC