I have a class with factory -pattern function in it:
abstract class ParentObj { public function __construct(){ ... } public static function factory(){
I need the children to be able to call the factory function and return an instance of the calling class: $child = Child::factory(); and preferably without overriding the factory function in the child class.
I tried several different ways to achieve this to no avail. I would rather stay away from solutions that use reflection, like __CLASS__ .
(I use PHP 5.2.5 if that matters)
oop php
Austin hyde
source share