ReflectionParameter::getDeclaringClass

(PHP 5)

ReflectionParameter::getDeclaringClassGets declaring class

Опис

public ReflectionClass ReflectionParameter::getDeclaringClass ( void )

Gets the declaring class.

Увага

This function is currently not documented; only its argument list is available.

Параметри

В цієї функції немає параметрів.

Значення, що повертаються

A ReflectionClass object.

Приклади

Приклад #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"
}

Прогляньте Також

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top