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 — دریافت اعلام کلاس
Description
دریافت اعلام کلاس.
Warning
This function is currently not documented; only its argument list is available.
Parameters
This function has no parameters.
Return Values
شی ReflectionClass.
metamarkers at gmail dot com ¶
6 days ago
