How can I check which file is a function in? [closed]
I'm working with PHP and sometimes, I want to find where the function being used is located. How can I do this easily without tracing through everything?
I usually just do a quick
'grep -d recurse "function\ function_name" *
from the root of the project.
Use the __FILE__
constant.
See here: http://php.net/manual/en/language.constants.predefined.php
you can use the notepad++ find in files function, works wonders.
Ctrl+Click in IDE (NetBeans, PhpStorm) at function's name
Add a logging class: Example here: http://llihp.blogspot.com/2011/05/php-logger-class.html
Cannot redeclare the function error
Check out the answer from dev-null-dweller here. VERY handy extension.
精彩评论