您好,欢迎访问一九零五行业门户网

php反射应用示例

<?php function custom(){ } class custom{ public function index(){ } } print_r(get_define_position('custom')); /** * / * @param string $name 函数名或者类名 * @return array */ function get_define_position($name){ $info = array(); if(class_exists($name)){ $ob = new reflectionclass($name); $info['class_'.$name]= array('file'=>$ob->getfilename(),'line'=>$ob->getstartline()); } if(function_exists($name)){ $ob = new reflectionfunction($name); $info['function_'.$name]= array('file'=>$ob->getfilename(),'line'=>$ob->getstartline()); } return $info; }
更多php反射应用示例。
其它类似信息

推荐信息