The ReflectionFunction class lets you reverse-engineer functions.
<?php
class ReflectionFunction implements Reflector {
public __construct(string name)
public string getName()
public bool isInternal()
public bool isUserDefined()
public string getFileName()
public int getStartLine()
public int getEndLine()
public string getDocComment()
public array getStaticVariables()
public mixed invoke(mixed* args)
public string toString()
public bool returnsReference()
public ReflectionParameter[] getParameters()
}
?> |
To introspect a function, you will first have to create an instance of the ReflectionFunction class. You can then call any of the above methods on this instance.
Note: The method invoke() accepts a variable number of arguments which are passed to the function just as in call_user_func().