note 61346 deleted from function.get-class by bjori
| From: | bjori@php.net | Date: | Wed, 01 Feb 2006 09:55:28 +0000 |
| Subject: | note 61346 deleted from function.get-class by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-102804@lists.php.net to get a copy of this message | ||
Note Submitter: ninja at hydracart dot com
----
darkfalconIV at hotmail dot com, I agree that this should be solved it is silly they won't fix
it. Devs you should consider this type of scenario.
abstract class A
{
public function instance()
{
static $instance = NULL;
if(!isset($instance))
{
$instance = new get_class();
}
return $instance;
}
}
class B extends B
{
}
B::instance();
I don't want to add method instance() in all my children classes when a way should exist to
describe this in the parent and be inherited.