Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<?php
trait message1 {
  public function msg1() {
    echo "OOP is fun! "; 
  }
}
class Welcome {
  use message1;
}
$obj = new Welcome();
$obj->msg1();
?>
 
</body>
<!-- Mirrored from www.mdssup.ma/php/phptryit.asp?filename=tryphp_keyword_trait by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 05 Sep 2022 15:02:05 GMT -->
</html>
OOP is fun!