ReflectionProperty::getDeclaringClass

(PHP 5)

ReflectionProperty::getDeclaringClassGets declaring class

Description

public ReflectionClass ReflectionProperty::getDeclaringClass ( void )

Gets the declaring class.

Warning

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

Parameters

This function has no parameters.

Return Values

A ReflectionClass object.

See Also

Коментарии

If you're reflecting an object and get the declaring class of a property that's set but wasn't declared in any class, it returns the class of the instance.

<?php

class {
   
}

$x = new X();
$x->foo 'bar';
$reflection = new ReflectionObject($x);
echo 
$reflection->getProperty('foo')->getDeclaringClass()->getName(); // X

?>
2013-05-17 09:30:47
http://php5.kiev.ua/manual/ru/reflectionproperty.getdeclaringclass.html

    Поддержать сайт на родительском проекте КГБ