Created
June 9, 2015 04:08
-
-
Save aaronpk/2661f15c613e9809f208 to your computer and use it in GitHub Desktop.
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 Hello { | |
public function sayHello() { | |
echo 'Hello '; | |
} | |
} | |
trait World { | |
public function sayWorld() { | |
echo 'World'; | |
} | |
} | |
class MyHelloWorld { | |
use Hello, World; | |
public function sayExclamationMark() { | |
echo '!'; | |
} | |
} | |
$o = new MyHelloWorld(); | |
$o->sayHello(); | |
$o->sayWorld(); | |
$o->sayExclamationMark(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment