3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function & do_something(& $arg) { $arg = 'func value'; return $arg; } $a = 'initial value'; $b = do_something($a); $b = 'new value'; var_dump($a, $b); $x = 'initial value'; $y = & do_something($x); $y = 'new value'; var_dump($x, $y);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
string(10) "func value" string(9) "new value" string(9) "new value" string(9) "new value"