Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- trait hello{
- public function say_hello(){
- echo "Hello world";
- }
- }
- trait bye{
- public function say_bye(){
- echo "Bye everyone";
- }
- }
- class base{
- use hello;
- use bye;
- }
- class base2{
- use hello;
- }
- $obj = new base();
- $obj2 = new base();
- $obj->say_hello();
- echo "<br>";
- $obj->say_bye();
- echo "<br>";
- $obj2->say_hello();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement