Re: LSB forward_static_call()

From: Date: Tue, 24 Jun 2008 17:14:52 +0000
Subject: Re: LSB forward_static_call()
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-38593@lists.php.net to get a copy of this message
<?php class A { function mA() { $this->nA(); } static function mB() { self::nB(); } } class B extends A { function mA() { parent::mA(); } static function mB() { parent::mB(); } function nA() { echo 'A'; } function nB() { echo 'B'; } } $obj = new B(); $obj->mA(); B::mB(); ?> Most people will think, that it will output AB. But currently in PHP 5.2 (I don't have PHP 5.3 to test it) it will output: A Fatal error: Call to undefined method A::nb() in Z:\localhost\testLSB.php on line 11 User that sees this, doesn't have any idea where is the problem and how to find some information about it.

« previous php.internals (#38593) next »