fix explanation/example about visibility of properties

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@208280 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Nuno Lopes 2006-02-28 23:45:58 +00:00
parent 4ce251b81d
commit dbc5194e46

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<refentry id="function.property-exists">
<refnamediv>
<refname>property_exists</refname>
@ -16,7 +16,7 @@
</methodsynopsis>
<para>
This function checks if the given <parameter>property</parameter> exists in
the specified class (and if it was declared as public).
the specified class (and if it is accessible from the current scope).
</para>
<note>
<para>
@ -71,11 +71,16 @@
class myClass {
public $mine;
private $xpto;
static function test() {
var_dump(property_exists('myClass', 'xpto')); // true, it can be accessed from here
}
}
var_dump(property_exists('myClass', 'mine')); //true
var_dump(property_exists(new myClass, 'mine')); //true
var_dump(property_exists('myClass', 'xpto')); //false, isn't public
myClass::test();
?>
]]>