复制代码 代码如下:
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;
}

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 Chinese version
Chinese version, very easy to use

WebStorm Mac version
Useful JavaScript development tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft