<?php class testing { protected function _getClass() { return 'testing_two'; } public function new() { $class = $this->_getClass(); return new $class(); } } class testing_two extends testing { } $a = new testing(); var_dump($a->new());
You have javascript disabled. You will not be able to edit any code.