note 57146 added to function.get-class

From: Date: Sun, 25 Sep 2005 09:25:13 +0000
Subject: note 57146 added to function.get-class
Groups: php.notes 
Request: Send a blank email to php-notes+get-95742@lists.php.net to get a copy of this message
There is one unexpected bahaviour (for me as least): <?php class parent { ... public function getInstance ($id) { ... print get_class() . "\n" . __CLASS__; ... } } class child extends parent { ... } child::getInstance(...); ?> This code will produce: parent parent So I can't make "new $className(...)" in getInstance(). The only option is to do a fabric. ---- Manual Page -- http://www.php.net/manual/en/function.get-class.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+57146 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57146&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57146&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57146&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57146&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57146&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57146&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57146&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+57146&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#95742) next »