-
-
Save ceeram/4098195 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
trait foo { function bob() { echo 'from trait'; }} | |
class bar { use foo { bob as likeBob }; function bob() { $this->likeBob();}} | |
class baz extends bar { function bob() { parent::bob(); echo ' from child'; }} | |
$a = new baz; | |
$a->bob(); | |
//result: from trait from child |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment