fork(1) download
  1. <?php
  2.  
  3. interface UserInterface {
  4. function getName();
  5. }
  6.  
  7. class UserClass implements UserInterface {
  8. function getName() {
  9. return "Вася";
  10. }
  11. };
  12.  
  13.  
  14. function printName (UserInterface $user) {
  15. echo $user->getName();
  16. }
  17.  
  18. $u = new UserClass;
  19.  
  20. foo($u);
Runtime error #stdin #stdout #stderr 0.01s 82880KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Fatal error:  Uncaught Error: Call to undefined function foo() in /home/rOoD4y/prog.php:20
Stack trace:
#0 {main}
  thrown in /home/rOoD4y/prog.php on line 20