3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function __construct($some, $args) {} function bar() { echo __METHOD__, PHP_EOL; } } function create($type, ...$args) { return (new ReflectionClass($type))->newInstance(...$args); } create('Foo', 'some', 'args')->bar();

This is an error 500

There are `>1` results


preferences:
153.3 ms | 2927 KiB | 7 Q