3v4l.org

run code in 200+ php & hhvm versions
<?php $array = array( 0 => 'val1', 2 => 'val2', 'A' => 'val3', 5 => 'val4', 7 => 'val5' ); $array = [...$array]; var_export($array);
based on KWPRH
Output for 7.4.0alpha1 - 7.4.0alpha2
Fatal error: Uncaught Error: Cannot unpack array with string keys in /in/2IgGh:10 Stack trace: #0 {main} thrown in /in/2IgGh on line 10
Process exited with code 255.
Output for 7.1.25 - 7.3.7
Parse error: syntax error, unexpected '...' (T_ELLIPSIS), expecting ']' in /in/2IgGh on line 10
Process exited with code 255.