fork(1) download
  1. <?php
  2.  
  3. class TestClass {
  4. public $hello = '';
  5. }
  6.  
  7. function modify($obj) {
  8. $obj = 42;
  9. }
  10.  
  11. $obj = new TestClass();
  12. $obj->hello = 'world';
  13.  
  14. modify($obj);
  15.  
  16. var_dump($obj->hello); // outputs "world"
  17.  
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
string(5) "world"