A good idea? Not
Do you want you to do this? Not
Proof of concept? Of course!
<?php a($test); function a($x) { $trace = debug_backtrace(); $file = file($trace[0]['file']); $line = $file[$trace[0]['line']-1]; var_dump($line);
Yes, it takes a βsimpleβ reading of the source file, it can also be done using a php extension called βbytekitβ that gives you user access to php opcodes and works from there.
source share