fork download
  1. <?php
  2.  
  3. class Foo {
  4. public $bar;
  5.  
  6. public function setBar($bar)
  7. {
  8. $this->bar = $bar;
  9. }
  10. }
  11.  
  12. class Init {
  13.  
  14. public function initFoo(Foo $foo)
  15. {
  16. $foo->setBar(5);
  17. //return $foo???
  18. }
  19. }
  20.  
  21. $foo = new Foo();
  22. $init = new Init();
  23. $init->initFoo($foo);
  24.  
Success #stdin #stdout 0s 82880KB
stdin
Standard input is empty
stdout
Standard output is empty