3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = ['cat', 'dog', 'horse']; $a =& $array[2]; var_dump($array); $a = $array[0]; echo "$a\n"; $a = $array[1]; echo "$a\n"; echo $array[2]; $a = $array[2]; echo "$a\n";
based on 2a9IJ
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
array(3) { [0]=> string(3) "cat" [1]=> string(3) "dog" [2]=> &string(5) "horse" } cat dog dogdog