Prev: How long before V5.3.3 hits the shelves?
Next: static call to an instance method in a class definition
From: samuel on 22 Jul 2010 12:09 Hello, Making a mistake I just come to discover ( for myself ) a strange fiture in php, lets see an example : class A{ public $foo = 'bar'; public function write(){ print($this->foo); } } class B{ public $foo = 'gnagnagna'; public function write(){ A::write(); } } $var = new B; $var->write(); This code will not throw excaption and output gnagnagna, it's kind of cross définition something, I know something like that exists in other language but I didn't expect PHP to work like that. Do you know this ? And why ? |