Re: foreach() broken

From: Date: Sun, 14 Sep 2003 15:33:21 +0000
Subject: Re: foreach() broken
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-4476@lists.php.net to get a copy of this message
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: <?php class Foo {
     function doFoo() {
       print_r($this);
     }
} class Bar {
     function doBar() {
       Foo::doFoo();
     }
} $bar = new Bar; $bar->doBar(); ?> bar Object ( ) I know that this code's logic is wrong (after the latest refactoring of the previously mentioned application I had a leftover (no unit tests, yet *sigh*) where a method was previously static).
Yes, (unfortunately) it's correct. We don't do instance checking on every method invocation because it would be dead slow... Zeev

« previous php.internals (#4476) next »