x
Search Posts:
BLOG POST #40 SHOW ALL

OOP: some PHP reflection class references

http://php.net/manual/en/class.reflectionmethod.php

http://www.php.net/manual/en/class.reflectionfunction.php

http://www.php.net/manual/en/reflectionproperty.ispublic.php

----------

check if a method is public and then execute it:

<?

if (method_exists($this, $method))
{
    $reflection = new ReflectionMethod($this, $method);
    if ($reflection->isPublic()) {
        $this->$method();
    }
}

?>