PHP traits

It may sound fancy, but it’s very simple and easy.


trait sharable{

	function foo(){
		echo "foo\n";
	}

}

class A{

	use sharable;

	function bar(){
		echo "bar\n";
	}

}

$a = new A();
$a->foo();
$a->bar();