note 91315 added to keyword.parent

From: Date: Fri, 05 Jun 2009 10:27:58 +0000
Subject: note 91315 added to keyword.parent
Groups: php.notes 
Request: Send a blank email to php-notes+get-156382@lists.php.net to get a copy of this message
take care of using parent::method with not declared method when using __call because in this case the string method will be lowercase: <?php class A { function __call( $method, $args ) { echo get_class( $this ) . ' ' . $method . "\n"; } } class B extends A { function getTest() { parent::getTest(); } } $a = new A(); $a->getTest(); $b = new B(); $b->getTest(); ?> output: A getTest B gettest ---- Server IP: 69.147.83.197 Probable Submitter: 87.29.134.198 ---- Manual Page -- http://www.php.net/manual/en/keyword.parent.php Edit -- https://master.php.net/note/edit/91315 Del: integrated -- https://master.php.net/note/delete/91315/integrated Del: useless -- https://master.php.net/note/delete/91315/useless Del: bad code -- https://master.php.net/note/delete/91315/bad+code Del: spam -- https://master.php.net/note/delete/91315/spam Del: non-english -- https://master.php.net/note/delete/91315/non-english Del: in docs -- https://master.php.net/note/delete/91315/in+docs Del: other reasons-- https://master.php.net/note/delete/91315 Reject -- https://master.php.net/note/reject/91315 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#156382) next »