fork(1) download
  1. <?php
  2. interface SomeInterface{
  3. public function someInterfaceFunction();
  4. }
  5.  
  6. trait SomeTrait {
  7. function sayHello(){
  8. echo "Hello my secret is ".static::$secret;
  9. }
  10. }
  11.  
  12. abstract class AbstractClass implements SomeInterface {
  13. use SomeTrait;
  14. }
  15.  
  16. class TestClass extends AbstractClass {
  17. static public $secret = 12345;
  18.  
  19. function someInterfaceFunction(){ }
  20. }
  21. $test = new TestClass();
  22. $test->sayHello();
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
Hello my secret is 12345