note 59785 added to function.get-class
| From: | darkfalconIV at hotmail dot com | Date: | Thu, 15 Dec 2005 16:58:52 +0000 |
| Subject: | note 59785 added to function.get-class | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-100216@lists.php.net to get a copy of this message | ||
davidc, that doesn't exactly work. As soon as you inherit everything breaks...
<?php
class Monkey
{
public static function getType(){
return __CLASS__;
}
}
class Man extends Monkey
{
}
?>
will return ''Monkey" if you call Man::getType(), which is not what we want. I really
can't think of any possible workaround that is inheritable(i.d., not doing something like
defining a class constant with the classes name in each class). If you want it to be fixed, good
luck...
http://bugs.php.net/bug.php?id=30423
----
Manual Page -- http://www.php.net/manual/en/function.get-class.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+59785
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59785&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59785&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59785&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59785&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59785&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59785&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59785&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+59785&report=yes
Search -- http://master.php.net/manage/user-notes.php