singleton is bad example for traits

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@315127 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Peter Cowburn 2011-08-18 09:08:00 +00:00
parent cff74cb12a
commit 911156099e

View file

@ -394,15 +394,17 @@ class MyHelloWorld {
<programlisting role="php">
<![CDATA[
<?php
trait Singleton {
public static function getInstance() { ... }
trait StaticExample {
public static function doSomething() {
return 'Doing something';
}
}
class MySingleton extends SomeUnrelatedSuperClass {
use Singleton;
class Example {
use StaticExample;
}
MySingleton::getInstance();
Example::doSomething();
?>
]]>
</programlisting>