Skip to content

Instantly share code, notes, and snippets.

@lorenzo
Created November 17, 2012 17:16
Show Gist options
  • Save lorenzo/4097781 to your computer and use it in GitHub Desktop.
Save lorenzo/4097781 to your computer and use it in GitHub Desktop.
trait foo { function bob() { echo 'from trait'; }}
class bar { use foo; }
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