3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array('id' => 'a','b','c','d','e','f','g'); $new_value = $array['id']; unset($arr['id']); array_unshift($array, $new_value); var_dump($array);
based on 4A86U
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: arr in /in/NodX6 on line 4 array(8) { [0]=> string(1) "a" ["id"]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" [3]=> string(1) "d" [4]=> string(1) "e" [5]=> string(1) "f" [6]=> string(1) "g" }
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: arr in /in/NodX6 on line 4 array(8) { [0]=> string(1) "a" ["id"]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" [3]=> string(1) "d" [4]=> string(1) "e" [5]=> string(1) "f" [6]=> string(1) "g" }