fork download
  1. <?php
  2.  
  3. class Foo
  4. {
  5. public $array = array('key' => "someFunc");
  6.  
  7. public function someFunc($foo, $bar);
  8. {
  9. return $foo;
  10. }
  11.  
  12. public function anotherFunc()
  13. {
  14. foreach($this->array as $value) {
  15. $bar = call_user_func(["Foo", $value], ["FOO", "BAR"]);
  16. }
  17.  
  18. return $bar;
  19. }
  20. }
  21.  
  22. $foo = new Foo();
  23.  
  24. var_dump($foo->anotherFunc());
Runtime error #stdin #stdout #stderr 0.02s 52472KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Fatal error:  Non-abstract method Foo::someFunc() must contain body in /home/frwTN5/prog.php on line 7