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 {
}
$x = new X();
$x->foo = 'bar';
$reflection = new ReflectionObject($x);
echo $reflection->getProperty('foo')->getDeclaringClass()->getName(); // X
?>
ReflectionProperty::getDeclaringClass
(PHP 5)
ReflectionProperty::getDeclaringClass — Gets declaring class
Descrição
Gets the declaring class.
Aviso
Esta função não está documentada; somente a lista de argumentos está disponível.
Parâmetros
Esta função não possui parâmetros.
Valor Retornado
A ReflectionClass object.
metamarkers at gmail dot com ¶
1 month ago
