fork(1) download
  1. <?php
  2.  
  3. function &f(&$y) { // two ref-signs here...
  4. return $y;
  5. }
  6.  
  7. $y = '';
  8. $x = array('a' => 1, 'b' => 2);
  9. $x['c'] = &f($y);
  10.  
  11. $y = 3;
  12. print_r($x);
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
Array
(
    [a] => 1
    [b] => 2
    [c] => 3
)