3v4l.org

run code in 200+ php & hhvm versions
<?php $array = array( 0 => 'val1', 2 => 'val2', 3.4 => 'val3', 5 => 'val4', 7 => 'val5' ); $array = [...$array]; var_export($array);
based on 66mVP
Output for 7.4.0alpha1 - 7.4.0alpha2
array ( 0 => 'val1', 1 => 'val2', 2 => 'val3', 3 => 'val4', 4 => 'val5', )
Output for 7.1.25 - 7.3.7
Parse error: syntax error, unexpected '...' (T_ELLIPSIS), expecting ']' in /in/gVrY8 on line 10
Process exited with code 255.