fork download
  1. <?php
  2. class Foo {
  3. public function bar($baz) {
  4. return 'I am bar from Foo and I know that baz is: '.$baz;
  5. }
  6. }
  7.  
  8. class Bar {
  9. public function callBar(Foo $foo, $baz) {
  10. return $foo->bar($baz);
  11. }
  12. }
  13.  
  14. $foo = new Foo();
  15. $bar = new Bar();
  16. echo $bar->callBar($foo, 10);
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
I am bar from Foo and I know that baz is: 10