Re: [PHP-DEV] foreach() broken

2003-09-14 Thread Zeev Suraski
At 13:15 14/09/2003, Sebastian Bergmann wrote: Sebastian Bergmann wrote: > I was not able to strip the application I'm seeing this in down to a > small, reproducing snippet, yet. Okay, here goes: class Bar { function doBar() { Foo::doFoo(); } } $bar = new Bar; $b

Re: [PHP-DEV] foreach() broken

2003-09-14 Thread Marcus Börger
Hello Sebastian, Sunday, September 14, 2003, 12:15:43 PM, you wrote: > Sebastian Bergmann wrote: >> I was not able to strip the application I'm seeing this in down to a >> small, reproducing snippet, yet. > Okay, here goes: >class Foo { > function doFoo() { >print_r($this

Re: [PHP-DEV] foreach() broken

2003-09-14 Thread Sebastian Bergmann
Sebastian Bergmann wrote: > I was not able to strip the application I'm seeing this in down to a > small, reproducing snippet, yet. Okay, here goes: doBar(); ?> bar Object ( ) I know that this code's logic is wrong (after the latest refactoring of the previously mentioned a

Re: [PHP-DEV] foreach() broken

2003-09-14 Thread Sebastian Bergmann
Sebastian Bergmann wrote: > That means I have to dig deeper into the application I spotted the > issue I wanted to report. A print_r($this); in the method that accesses the member array yielded a surprising result: $this does not point to the object on which the method is called but rather t

Re: [PHP-DEV] foreach() broken

2003-09-14 Thread Sebastian Bergmann
Sebastian Bergmann wrote: > 8 $this->foo = array(new Foo, new Foo); > 9 foreach ($foo as $bar) {} s/$foo/$this->foo/ and this example works. Damn. That means I have to dig deeper into the application I spotted the issue I wanted to report. -- Sebastian Bergmann http://sebastian

Re: [PHP-DEV] foreach() broken

2003-09-14 Thread Wez Furlong
> 7 public function __construct() { > 8 $this->foo = array(new Foo, new Foo); > 9 foreach ($foo as $bar) {} $this->foo ? >Warning: Invalid argument supplied for foreach() >in E:\test.php on line 9 -- PHP Internals - PHP Runtime Development Mailing List To unsubscr