The Reflection API is the perfect way to reverse engineer and inspect php objects and functions. I have written a function to quickly pass params to the Reflection API and get things done.
Here’s the source codes:
<?php function reflect($data,$return = false) { $string = "\n \nReflecting: {$data} \n"; $string .= "\n====================\n"; if(is_object($data)) { $string .= Reflection::export( new ReflectionClass($data), true ); $string .= "\n====================\n"; } else { if(function_exists($data)) { $string .= Reflection::export( new ReflectionFunction($data), true ); $string .= "\n====================\n"; } } if($return) { return $string; } else { echo $string; } } ?>
Pingback: A reflect() Function For Quick Reflection in PHP « maSnun.com | Coder Online