(PHP 5)
ReflectionProperty::isProtected — Checks if property is protected
Checks whether the property is protected.
此函数没有参数。
TRUE
if the property is protected, FALSE
otherwise.
Ievgen Iefimenko the_boss at bk dot ru (2012-06-09 21:44:09)
<?php
/**
* Return 1 if property is public,
* else return void
*/
class Classname{
private $variable;
}
$obj = new Classname;
$rp = new ReflectionProperty($obj,'variable');
echo $rp->isPrivate();
?>