A very simple function, using the reflection mechanism in PHP, specifically using the ReflectionFunction class, to obtain the specific location in the PHP script where the specified function is located. Create a reference script.
// Filename: functions.php <?php function now() { return time(); } ?>
Call the function.
// Filename: call_now.php <?php require 'functions.php'; Reflection::export(new ReflectionFunction('now')); // Function [ function now ] { @@ H:\www\functions.php 2 - 4 } ?>