mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
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:
parent
4ce251b81d
commit
dbc5194e46
1 changed files with 7 additions and 2 deletions
|
@ -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();
|
||||
|
||||
?>
|
||||
]]>
|
||||
|
|
Loading…
Reference in a new issue