具体如下:
//参数1是类名,参数2是方法名
$func = new ReflectionMethod('UnifiedOrder_pub', 'getPrepayId');
//从第几行开始
$start = $func->getStartLine() - 1;
//从第几行结束
$end = $func->getEndLine() - 1;
//获取路径地址
$filename = $func->getFileName();下面是摘抄的示例代码比较全面
getMessage();
return;
}
$start = $func->getStartLine() - 1;
$end = $func->getEndLine() - 1;
$filename = $func->getFileName();
echo "function $funcname defined by $filename($start - $end)\n";
}
function_dump('a');
function_dump(array('b', 'f'));
$b = new b();
function_dump(array($b, 'f'));
?>