3v4l.org

run code in 200+ PHP versions simultaneously
<?php $a = array(1 => 1, 'c'=>2, 'b'=>3, 'd'=>4); $a[] = "first value with implicit key"; unset($a['c']); $a['a'] = "new a"; $a[] = "second value with implicit key"; $a['b'] = "replaced b"; var_export($a);
based on OI1pN
Output for 4.3.0 - 7.2.6
array ( 1 => 1, 'b' => 'replaced b', 'd' => 4, 2 => 'first value with implicit key', 'a' => 'new a', 3 => 'second value with implicit key', )