Skip to content

Instantly share code, notes, and snippets.

@sambfreund
Created July 7, 2016 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sambfreund/a4a281dbe6abe2a32347b8c135796d83 to your computer and use it in GitHub Desktop.
Save sambfreund/a4a281dbe6abe2a32347b8c135796d83 to your computer and use it in GitHub Desktop.
This finds a function's origin. Useful in files with multiple include files. I don't take credit for this, but just don't remember where I found it.
$reflFunc = new ReflectionFunction('FUNCTION NAME');
print $reflFunc->getFileName() . ':' . $reflFunc->getStartLine();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment