foreach() broken
| From: | Sebastian Bergmann | Date: | Sun, 14 Sep 2003 08:54:47 +0000 |
| Subject: | foreach() broken | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-4467@lists.php.net to get a copy of this message | ||
1 <?php
2 class Foo {}
3
4 class Bar {
5 protected $foo = array();
6
7 public function __construct() {
8 $this->foo = array(new Foo, new Foo);
9 foreach ($foo as $bar) {}
10 }
11 }
12
13 new Bar;
14 ?>
Warning: Invalid argument supplied for foreach()
in E:\test.php on line 9
--
Sebastian Bergmann
http://sebastian-bergmann.de/ http://phpOpenTracker.de/
Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-php5.de/