note 109448 modified in language.oop5.traits by danbrown
| From: | danbrown@php.net | Date: | Fri, 20 Jul 2012 15:30:11 +0000 |
| Subject: | note 109448 modified in language.oop5.traits by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-189339@lists.php.net to get a copy of this message | ||
Not very obvious but trait methods can be called as if they were defined as static methods in a
regular class <?php trait Foo
{ 	function bar() { 		return
'baz'; 	} } echo
Foo::bar(),"\\n"; ?>
--was--
Not very obvious but trait methods can be called as if they were defined as static methods in a
regular class
<?php
trait Foo {
function bar() {
return 'baz';
}
}
echo Foo::bar(),"\n";
http://php.net/manual/en/language.oop5.traits.php