3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static function make() { return new static(); } } class ChildOfFoo extends Foo { public function __construct($a) { $this->a = $a;} } $b = ChildOfFoo::make(); var_dump($b);

preferences:
34.02 ms | 402 KiB | 5 Q