【发布时间】:2012-04-20 17:05:32
【问题描述】:
我想要这样的东西,但从这样的数组动态:
$array = array("first","second","third");
所以类会这样调用:
$class = new class("first","second","third");
【问题讨论】:
我想要这样的东西,但从这样的数组动态:
$array = array("first","second","third");
所以类会这样调用:
$class = new class("first","second","third");
【问题讨论】:
你可以使用反射:
$refClass = new ReflectionClass('SomeClass');
$instance = $refClass->newInstanceArgs($args);
【讨论】: