Re: behaviour of static calls to regular methods

From: Date: Tue, 22 Jun 2004 16:39:26 +0000
Subject: Re: behaviour of static calls to regular methods
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-10713@lists.php.net to get a copy of this message
Yeah for BC sake, but if you define the function's as static explicitly it won't work. At 01:54 PM 6/21/2004 +0200, Ard Biesheuvel wrote:
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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.internals (#10713) next »