3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Thing { public function __construct($one, $two, $three) { var_dump($one, $two, $three); } } class ThingFactory { private $reflector; public function __construct() { $this->reflector = new \ReflectionClass('Thing'); } public function create() { return $this->reflector->newInstanceArgs(func_get_args()); } } (new ThingFactory)->create(1, 2, 3);

preferences:
45.3 ms | 402 KiB | 5 Q