note 119369 rejected from language.oop5.basic by cmb

From: Date: Mon, 23 May 2016 10:42:03 +0000
Subject: note 119369 rejected from language.oop5.basic by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-205537@lists.php.net to get a copy of this message
Note Submitter: flyphp at 163 dot com ---- i try to use class B to extends A to get the results,whta i know result is jim,b,but the result layout is b,jim,b.when i change the class name or function name to another like Class C or function c(),the result is jim,b,i don't know why. class A{ public $name = "jim"; public function a(){ echo "b"; } } class B extends A{ } $b = new B; echo $b->name; //bjim echo "\n"; $b->a(); //b after change: class AA{ public $name = "jim"; public function a(){ echo "b"; } } class B extends AA{ } $b = new B; echo $b->name; //jim echo "\n"; $b->a(); //b

« previous php.notes (#205537) next »