Gets declaring class for the reflected method

# ReflectionMethod::getDeclaringClass

(PHP 5, PHP 7)

ReflectionMethod::getDeclaringClass — Gets declaring class for the reflected method

### Descrierea

public ReflectionMethod::getDeclaringClass ( void ) : ReflectionClass

Gets the declaring class for the reflected method.

### Parametri

Această funcție nu are parametri.

### Valorile întoarse

A ReflectionClass object of the class that the reflected method is part of.

### Exemple

Example #1 ReflectionMethod::getDeclaringClass() example

`<?php
class HelloWorld {
protected function sayHelloTo($name) {
return 'Hello ' . $name;
}
}
$reflectionMethod = new ReflectionMethod(new HelloWorld(), 'sayHelloTo');
var_dump($reflectionMethod->getDeclaringClass());
?>`

Exemplul de mai sus va afișa:

    object(ReflectionClass)#2 (1) {
      ["name"]=>
      string(10) "HelloWorld"
    }

### A se vedea și

- ReflectionMethod::isAbstract() - Checks if method is abstract