cvs: phpdoc /en/language/oop5 late-static-bindings.xml
| From: | Etienne Kneuss | Date: | Tue, 29 Jul 2008 00:29:44 +0000 |
| Subject: | cvs: phpdoc /en/language/oop5 late-static-bindings.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-1949@lists.php.net to get a copy of this message | ||
colder Tue Jul 29 00:29:44 2008 UTC
Modified files:
/phpdoc/en/language/oop5 late-static-bindings.xml
Log:
Document parent::/self:: forwarding in LSB
http://cvs.php.net/viewvc.cgi/phpdoc/en/language/oop5/late-static-bindings.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/language/oop5/late-static-bindings.xml
diff -u phpdoc/en/language/oop5/late-static-bindings.xml:1.2
phpdoc/en/language/oop5/late-static-bindings.xml:1.3
--- phpdoc/en/language/oop5/late-static-bindings.xml:1.2 Mon Nov 12 12:10:43 2007
+++ phpdoc/en/language/oop5/late-static-bindings.xml Tue Jul 29 00:29:44 2008
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<sect1 xml:id="language.oop5.late-static-bindings" xmlns="http://docbook.org/ns/docbook">
<title>Late Static Bindings</title>
<para>
@@ -153,10 +153,10 @@
</example>
<note>
<para>
- Late static bindings' resolution will stop at a fully resolved static call with no
fallback.
+ Late static bindings' resolution will stop at a fully resolved static call with no
fallback. On the other hand, static calls using keywords like
<literal>parent::</literal> or <literal>self::</literal> will forward the
calling information.
</para>
<example>
- <title>Fully resolved static calls</title>
+ <title>Forwarding and non-forwarding calls</title>
<programlisting role="php">
<![CDATA[
<?php
@@ -173,14 +173,21 @@
class B extends A {
public static function test() {
A::foo();
+ parent::foo();
+ self::foo();
}
public static function who() {
echo __CLASS__."\n";
}
}
+class C extends B {
+ public static function who() {
+ echo __CLASS__."\n";
+ }
+}
-B::test();
+C::test();
?>
]]>
</programlisting>
@@ -188,6 +195,8 @@
<screen>
<![CDATA[
A
+C
+C
]]>
</screen>
</example>