behaviour of static calls to regular methods

From: Date: Mon, 21 Jun 2004 12:54:02 +0000
Subject: behaviour of static calls to regular methods
Groups: php.internals 
Request: Send a blank email to internals+get-10676@lists.php.net to get a copy of this message
Is the fact that the following code works intentional ? class S {
        function func() {
                A::meth();
        }
} class A {
        private $bar;
        function meth() {
                $this->bar="bar";
        }
        function func() {
                S::func();
                echo "$this->bar\n";
        }
} $a = new A; $a->func(); ... so A::$this is accessed through two static calls to different classes. -- Ard

« previous php.internals (#10676) next »