Created
December 15, 2014 08:08
-
-
Save technoknol/61169aa22b6e636a437d to your computer and use it in GitHub Desktop.
Get where function is declared file name and line no.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Get where function is declared file name and line number. | |
$r = new ReflectionFunction('selected'); // ReflectionFunction is a PHP in-built class | |
echo $file = $r->getFileName(); // getFileName() is inherited method. | |
echo $startLine = $r->getStartLine(); // getStartLine() is inherited method. | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment