svn: /phpdoc/en/trunk/reference/reflection/reflectionproperty/ isdefault.xml

From: Date: Sat, 15 Aug 2015 16:29:14 +0000
Subject: svn: /phpdoc/en/trunk/reference/reflection/reflectionproperty/ isdefault.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-13594@lists.php.net to get a copy of this message
cmb Sat, 15 Aug 2015 16:29:14 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=337485 Log: improved ReflectionProperty::isDefault() docs Changed paths: U phpdoc/en/trunk/reference/reflection/reflectionproperty/isdefault.xml Modified: phpdoc/en/trunk/reference/reflection/reflectionproperty/isdefault.xml =================================================================== --- phpdoc/en/trunk/reference/reflection/reflectionproperty/isdefault.xml 2015-08-15 16:15:48 UTC (rev 337484) +++ phpdoc/en/trunk/reference/reflection/reflectionproperty/isdefault.xml 2015-08-15 16:29:14 UTC (rev 337485) @@ -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>

« previous php.doc.cvs (#13594) next »