Skip to content

Instantly share code, notes, and snippets.

@mikale
Created July 6, 2011 07:24
<?php
trait foo{
function testFoo(){
echo 'foo';
}
}
class bar {
use foo;
function testBar(){
echo 'bar';
}
}
$obj = new bar();
$obj -> testFoo(); // foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment