Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...

When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store


Basic usage is simple:

$function Zend_Server_Reflection::reflectFunction('my_function');

// Get prototypes
$prototypes $reflection->getPrototypes();

// Loop through each prototype for the function
foreach ($prototypes as $prototype) {

// Get prototype return type
echo "Return type: "$prototype->getReturnType(), "\n";

// Get prototype parameters
$parameters $prototype->getParameters();

"Parameters: \n";
    foreach (
$parameters as $parameter) {
// Get parameter type
echo "    "$parameter->getType(), "\n";

// Get namespace for a class, function, or method.
// Namespaces may be set at instantiation time (second argument), or using
// setNamespace()

reflectFunction() returns a Zend_Server_Reflection_Function object; reflectClass() returns a Zend_Server_Reflection_Class object. Please refer to the API documentation to see what methods are available to each.

Zend Framework