Re: __CLASS__ patch - returns called class
| From: | Alan Knowles | Date: | Fri, 05 Apr 2002 09:34:17 +0000 |
| Subject: | Re: __CLASS__ patch - returns called class | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-82125@lists.php.net to get a copy of this message | ||
Any chance of sneeking this one in :) - patch attached
usage:
<?
class testclass2 extends testclass { }
class testclass {
function test() {
echo __CLASS__;
}
}
testclass2::test();
$t = new testclass2();
$t->test();
?>
prints
testclass2
testclass2
extremely usefull for building mulitiple extendable constructors.
regards
alan