mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
improved ReflectionProperty::isDefault() docs
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@337485 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
878a454b06
commit
5399e97fab
1 changed files with 36 additions and 1 deletions
|
@ -4,7 +4,7 @@
|
|||
<refentry xml:id="reflectionproperty.isdefault" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>ReflectionProperty::isDefault</refname>
|
||||
<refpurpose>Checks if default value </refpurpose>
|
||||
<refpurpose>Checks if property is a default property</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
|
@ -32,6 +32,41 @@
|
|||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><methodname>ReflectionClass::isDefault</methodname> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class Foo {
|
||||
public $bar;
|
||||
}
|
||||
|
||||
$rc = new ReflectionClass('Foo');
|
||||
$rp = $rc->getProperty('bar');
|
||||
var_dump($rp->isDefault());
|
||||
|
||||
$o = new Foo();
|
||||
$o->baz = 42;
|
||||
$ro = new ReflectionObject($o);
|
||||
$rp = $ro->getProperty('baz');
|
||||
var_dump($rp->isDefault());
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bool(true)
|
||||
bool(false)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
|
|
Loading…
Reference in a new issue