3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = [ '1' , '2', '3' ]; rsort( array_map($test, 'intval') ); var_dump($test);
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, array callback must have exactly two members in /in/7EtEL:8 Stack trace: #0 /in/7EtEL(8): array_map(Array, 'intval') #1 {main} thrown in /in/7EtEL on line 8
Process exited with code 255.
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 Fatal error: Uncaught TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, array callback must have exactly two members in /in/7EtEL:8 Stack trace: #0 /in/7EtEL(8): array_map(Array, 'intval') #1 {main} thrown in /in/7EtEL on line 8
Process exited with code 255.
Output for 8.1.0 - 8.1.28
Fatal error: Uncaught TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, array must have exactly two members in /in/7EtEL:8 Stack trace: #0 /in/7EtEL(8): array_map(Array, 'intval') #1 {main} thrown in /in/7EtEL on line 8
Process exited with code 255.
Output for 8.0.0 - 8.0.30
Fatal error: Uncaught TypeError: array_map(): Argument #1 ($callback) must be a valid callback, array must have exactly two members in /in/7EtEL:8 Stack trace: #0 /in/7EtEL(8): array_map(Array, 'intval') #1 {main} thrown in /in/7EtEL on line 8
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Warning: array_map() expects parameter 1 to be a valid callback, array must have exactly two members in /in/7EtEL on line 8 Notice: Only variables should be passed by reference in /in/7EtEL on line 8 Warning: rsort() expects parameter 1 to be array, null given in /in/7EtEL on line 8 array(3) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "3" }
Output for 7.3.32 - 7.3.33
Warning: array_map() expects parameter 1 to be a valid callback, array must have exactly two members in /in/7EtEL on line 8 Warning: rsort() expects parameter 1 to be array, null given in /in/7EtEL on line 8 array(3) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "3" }
Output for 5.6.0 - 5.6.40
Warning: array_map() expects parameter 1 to be a valid callback, array must have exactly two members in /in/7EtEL on line 8 Strict Standards: Only variables should be passed by reference in /in/7EtEL on line 9 Warning: rsort() expects parameter 1 to be array, null given in /in/7EtEL on line 9 array(3) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "3" }

preferences:
197.13 ms | 402 KiB | 290 Q