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.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
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 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 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:
154.78 ms | 402 KiB | 172 Q