diff --git a/language/oop5/traits.xml b/language/oop5/traits.xml
index 3dbc0c7baa..7833ad711b 100644
--- a/language/oop5/traits.xml
+++ b/language/oop5/traits.xml
@@ -72,6 +72,263 @@ class ezcReflectionFunction extends ReflectionFunction {
/* ... */
}
?>
+]]>
+
+
+
+ Precedence Order Example
+ An inherited method from a base class is overridden by the
+ method inserted into MyHelloWorld from the SayWorld Trait. The behavior is
+ the same for methods defined in the MyHelloWorld class. The precedence order
+ is that methods from the current class override Trait methods, which in
+ turn override methods from the base class.
+
+sayHello();
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+ Precedence Order Example #2
+
+sayHello();
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+ Multiple Traits Usage
+
+sayHello();
+$o->sayWorld();
+$o->sayExclamationMark();>
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+ Conflict Resolution
+
+
+]]>
+
+
+
+ Traits Composed from Traits
+
+sayHello();
+$o->sayWorld();
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+ Express Requirements by Abstract Methods
+
+getWorld();
+ }
+ abstract public function getWorld();
+}
+
+class MyHelloWorld {
+ private $world;
+ use Hello;
+ public function getWorld() {
+ return $this->world;
+ }
+ public function setWorld($val) {
+ $this->world = $val;
+ }
+}
+?>
+]]>
+
+
+
+ Static Variables
+
+inc(); // echo 1
+ $p = new C2(); $p->inc(); // echo 1
+?>
+]]>
+
+
+
+ Static Methods
+
+
]]>
@@ -96,4 +353,4 @@ sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
-vi: ts=1 sw=1
+vi: ts=1 sw=1
-->