3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FooBar { private function __construct() { } public static function newBaz() { return new Baz(); } } class Baz extends FooBar {} var_dump(get_class(FooBar::newBaz())); //var_dump(get_class(new Baz()));

preferences:
22.85 ms | 404 KiB | 5 Q