static call bugs?

From: Date: Fri, 09 Mar 2001 23:56:27 +0000
Subject: static call bugs?
Groups: php.dev 
Request: Send a blank email to php-dev+get-48471@lists.php.net to get a copy of this message
Hi, 1) I am currently completing the php documentation to cover all undocumented features and I have noticed that using a static method call to the same class from on instanciated object exhibits the presence of the instance within the static call 2) If you uncomment the marked line, you will get an error without any reason... I guess these are bugs, aren't they? <?php class foo {
    function moo()  {
        // $this->boo=2; // try to remove the comments
        print '$this is ';
        if (!isset($this)) {
            print 'not set';
            foo::zoo();
        } else {
            print 'set';
            $this->zoo();
            foo::zoo();
        }
    }
    function zoo()  {
        print '<br>'.'I have been called '.(!isset($this) ? 'statically':'via $this->zoo()');
        var_dump($this);
        }
} $s=new foo(); $s->moo(); ?><BR><?php foo::moo(); ?> andré -- · André Langhorst t: +49 331 5811560 · · andre@php.net m: +49 173 9558736 · * PHP Quality Assurance http://qa.php.net *

« previous php.dev (#48471) next »