3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Output using xdebug $zero = 'zero'; $ary = array($zero, 'one', 'two'); //unset($ary[1]); unset($ary[2]); unset($ary[1]); $bry = $ary; $ary[] = 'three'; $bry[] = 'three'; var_dump($ary, $bry, $ary == $bry);
Output for 5.4.34 - 7.1.0
array(2) { [0]=> string(4) "zero" [3]=> string(5) "three" } array(2) { [0]=> string(4) "zero" [3]=> string(5) "three" } bool(true)
Output for 4.3.0 - 5.4.32
array(2) { [0]=> string(4) "zero" [1]=> string(5) "three" } array(2) { [0]=> string(4) "zero" [3]=> string(5) "three" } bool(false)