(PHP 5, PHP 7)
ReflectionParameter::getDeclaringClass — Gets declaring class
Gets the declaring class.
本函数还未编写文档,仅有参数列表。
此函数没有参数。
A ReflectionClass object.
Example #1 Getting the class that declared the method
<?php
class Foo
{
public function bar(\DateTime $datetime)
{
}
}
class Baz extends Foo
{
}
$param = new \ReflectionParameter(['Baz', 'bar'], 0);
var_dump($param->getDeclaringClass());
以上例程会输出:
object(ReflectionClass)#2 (1) { ["name"]=> string(3) "Foo" }