Home > php教程 > php手册 > php获取当前文件所有执行的函数和类

php获取当前文件所有执行的函数和类

WBOY
Release: 2016-06-13 10:58:57
Original
1197 people have browsed it

获取当前文件所有执行的函数和类
array get_defined_functions ( void )

//返回一个多维数组,它包含所有已定义的函数的列表,同时内置(内部)和用户定义的。内部功能将通过$改编[访问"内部"],并在用户定义的使用$改编["用户"](见下面的例子)。

function myrow($id, $data)
{
    return "<tr><th>$id</th><td>$data</td></tr>n";
}

$arr = get_defined_functions();

print_r($arr);

array get_declared_classes ( void ) //返回在当前脚本中声明的类的名称的数组。

print_r(get_declared_classes());
/*
array
(
    [0] => stdclass
    [1] => __php_incomplete_class
    [2] => directory
)
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template