note 108983 modified in reflectionproperty.isprotected by danbrown

From: Date: Wed, 13 Jun 2012 15:31:27 +0000
Subject: note 108983 modified in reflectionproperty.isprotected by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-188584@lists.php.net to get a copy of this message
&#60;?php&#13;&#10;&#13;&#10;/**&#13;&#10;* Return 1 if property is public,&#13;&#10;* else return void&#13;&#10;*/&#13;&#10;&#13;&#10;class Classname{&#13;&#10;&#9;private $variable;&#13;&#10;}&#13;&#10;&#13;&#10;$obj = new Classname;&#13;&#10;$rp = new ReflectionProperty($obj,&#39;variable&#39;);&#13;&#10;echo $rp-&#62;isPrivate();&#13;&#10;?&#62; --was-- <?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(); http://php.net/manual/en/reflectionproperty.isprotected.php

« previous php.notes (#188584) next »