3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = 0; function passByReference(&$a) { $a = 5; //return $a++; } function passByValue($a) { return --$a; } echo $a."\n"; $b = passByValue($a); echo "b = $b \n"; echo $a."\n"; passByReference($a); echo $a."\n";
based on Y3eHq
Output for 5.6.0 - 7.3.0beta1
0 b = -1 0 5