fork download
  1. <?php
  2. class A{
  3. public static function hello(){
  4. echo 'hello';
  5. }
  6. }
  7.  
  8. class B extends A{
  9. public function ok(){
  10. echo 'ok';
  11. }
  12.  
  13. public static function fprint(){
  14. A::hello();
  15. B::ok();
  16. }
  17. }
  18.  
  19. $obj = new B;
  20. $obj->fprint();
  21. ?>
Success #stdin #stdout #stderr 0.02s 52472KB
stdin
Standard input is empty
stdout
hellook
stderr
PHP Strict Standards:  Non-static method B::ok() should not be called statically in /home/KO5MAy/prog.php on line 16