<?php interface UserInterface { function getName();} class UserClass implements UserInterface { function getName() { return "Вася"; }}; function printName (UserInterface $user) { echo $user->getName();} $u = new UserClass; foo($u);
Standard input is empty
Standard output is empty
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
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!