- print_r: documentation ( source)
<?php
class Foo {
private $name = 'foo';
public static function make() {
$this->clazz = get_class($this);
return new $this->clazz();
}
}
class Bar extends Foo {
private $name = 'bar';
}
print_r(Foo::make());
print_r(Bar::make());