Skip to content

Instantly share code, notes, and snippets.

@teepluss
Last active August 29, 2015 14:14
Show Gist options
  • Save teepluss/565da1b739ce6a7788c9 to your computer and use it in GitHub Desktop.
Save teepluss/565da1b739ce6a7788c9 to your computer and use it in GitHub Desktop.
Trait Extending
<?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