Created
October 29, 2017 14:17
-
-
Save iboved/7eaef45204fba91d48220a31b84e483f to your computer and use it in GitHub Desktop.
This file contains hidden or 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 A { | |
public function smallTalk() { | |
echo 'a'; | |
} | |
public function bigTalk() { | |
echo 'A'; | |
} | |
} | |
trait B { | |
public function smallTalk() { | |
echo 'b'; | |
} | |
public function bigTalk() { | |
echo 'B'; | |
} | |
} | |
class Talker { | |
use A, B { | |
B::smallTalk insteadof A; | |
A::bigTalk insteadof B; | |
} | |
} | |
class Aliased_Talker { | |
use A, B { | |
B::smallTalk insteadof A; | |
A::bigTalk insteadof B; | |
B::bigTalk as talk; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment