note 57146 deleted from function.get-class by cmb
| From: | cmb@php.net | Date: | Wed, 30 Nov 2016 16:29:55 +0000 |
| Subject: | note 57146 deleted from function.get-class by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-207753@lists.php.net to get a copy of this message | ||
Note Submitter: wired at evd dot ru
----
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.