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]);
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
Deprecated: Implicit conversion from float -10.9 to int loses precision in /in/7apMc on line 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.4.3 - 7.4.33, 8.0.0 - 8.0.30
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.33
Parse error: syntax error, unexpected '...' (T_ELLIPSIS), expecting ']' in /in/7apMc on line 5
Process exited with code 255.

preferences:
146.32 ms | 409 KiB | 5 Q