svn: /phpdoc/en/trunk/language/oop5/ overloading.xml
| From: | Kalle Sommer Nielsen | Date: | Sat, 23 Oct 2010 14:06:51 +0000 |
| Subject: | svn: /phpdoc/en/trunk/language/oop5/ overloading.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-7311@lists.php.net to get a copy of this message | ||
kalle Sat, 23 Oct 2010 14:06:51 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=304662
Log:
Added a remark about overloaded properties and language constructs (Bug #43936)
Bug: http://bugs.php.net/43936 (Open) __empty() magic method
Changed paths:
U phpdoc/en/trunk/language/oop5/overloading.xml
Modified: phpdoc/en/trunk/language/oop5/overloading.xml
===================================================================
--- phpdoc/en/trunk/language/oop5/overloading.xml 2010-10-23 13:58:42 UTC (rev 304661)
+++ phpdoc/en/trunk/language/oop5/overloading.xml 2010-10-23 14:06:51 UTC (rev 304662)
@@ -144,6 +144,20 @@
</para>
</note>
+ <note>
+ <para>
+ It is not possible to use overloaded properties in other
+ language constructs than <function>isset</function>. This
+ means if <function>empty</function> is called on an overloaded
+ property, the overloaded method is not called.
+ </para>
+ <para>
+ To workaround that limitation, the overloaded property must
+ be copied into a local variable in the scope and then be
+ handed to <function>empty</function>.
+ </para>
+ </note>
+
<example>
<title>
Overloading properties via the <function>__get</function>,