3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $costs = []; $numbers = [12,67,205,305,256]; for ($x = 0; $x < sizeof($numbers); $x++) { $numberClone = $numbers; var_dump($numberClone); unset($numberClone[$i]); var_dump($numberClone); die; $numberClone = array_merge($numberClone); }
based on gJUo4
Output for 5.4.0 - 7.3.0rc4
array(5) { [0]=> int(12) [1]=> int(67) [2]=> int(205) [3]=> int(305) [4]=> int(256) } Notice: Undefined variable: i in /in/Gj8Ic on line 12 array(5) { [0]=> int(12) [1]=> int(67) [2]=> int(205) [3]=> int(305) [4]=> int(256) }
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/Gj8Ic on line 3
Process exited with code 255.