Last active
August 29, 2015 14:14
-
-
Save teepluss/565da1b739ce6a7788c9 to your computer and use it in GitHub Desktop.
Trait Extending
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
trait Name { | |
function say($word) | |
{ | |
return $word; | |
} | |
} | |
trait Fullname { | |
use Name; | |
function saying($word) | |
{ | |
return "Your fullname is " . $this->say($word); | |
} | |
} | |
class Combine { | |
use Fullname; | |
function echos($word) | |
{ | |
return $this->saying($word); | |
} | |
} | |
echo (new Combine)->echos('Teepluss'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment