脚本宝典收集整理的这篇文章主要介绍了PHP---反射--继续剖析,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
<?PHP class mycoach { PRotected $name; protected $age; protected $expertise=array(); public function __construct($name,$age) { $this->name=$name; $this->age=$age; } public function setskill(Array $skill) { $this->skill = $skill; var_dump($this->skill); return (Array) $this->skill; } } $coach = new ReflectionClass(‘mycoach‘); if ($coach->isInstantiable()) { echo "可以实例化".PHP_EOL; } $myinIT = $coach->getConstructor();
输出结果:
array(2) { [0]=>
object(ReflectionParameter)#3 (1) { ["name"]=>
string(4) "name" } [1]=>
object(ReflectionParameter)#4 (1) { ["name"]=>
string(3) "age" } }
输出结果:
以上是脚本宝典为你收集整理的PHP---反射--继续剖析全部内容,希望文章能够帮你解决PHP---反射--继续剖析所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。