- var_dump: documentation ( source)
<?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);