3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [2 => 4, 5 => 3, "3" => null, -10.9 => 'foo']; echo 'array_values(): '; var_export(array_values($array)); echo "\nsplatpack: "; var_export([...$array]);
based on oobnN
Output for 7.4.3 - 7.4.13, 8.0.0 - 8.0.2
array_values(): array ( 0 => 4, 1 => 3, 2 => NULL, 3 => 'foo', ) splatpack: array ( 0 => 4, 1 => 3, 2 => NULL, 3 => 'foo', )
Output for 7.1.25 - 7.1.31, 7.2.0 - 7.2.33, 7.3.0 - 7.3.26
Parse error: syntax error, unexpected '...' (T_ELLIPSIS), expecting ']' in /in/7apMc on line 5
Process exited with code 255.