3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array(1); $a =& $arr[0]; //$a and $arr[0] are in the same reference set $arr2 = $arr; //not an assignment-by-reference! $arr2[0]++; var_export($a); echo "\n"; var_export($arr); echo "\n"; var_export($arr2);
Output for 4.3.0 - 7.2.0
2 array ( 0 => 2, ) array ( 0 => 2, )