3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Input & Output Streams $input = fopen("php://stdin", "r"); $output = fopen(getenv('OUTPUT_PATH'),"w"); // Count Arguments $argument_count = 0; fscanf($input, "%d", $argument_count); // Argument Values $arguments = []; for ($i=0; $i < $argument_count; $i++) { $arguments[] = json_decode(trim(fgets($input)), true, 16); } // Run Candidate Code $result = call_user_func_array('dedupe', $arguments); // Output Result fwrite($output, json_encode($result)); fclose($output);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught ValueError: Path cannot be empty in /in/0Temo:5 Stack trace: #0 /in/0Temo(5): fopen('', 'w') #1 {main} thrown in /in/0Temo on line 5
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 ValueError: Path cannot be empty in /in/0Temo:5 Stack trace: #0 /in/0Temo(5): fopen('', 'w') #1 {main} thrown in /in/0Temo on line 5
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: fopen(): Filename cannot be empty in /in/0Temo on line 5 Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'dedupe' not found or invalid function name in /in/0Temo on line 18 Warning: fwrite() expects parameter 1 to be resource, bool given in /in/0Temo on line 21 Warning: fclose() expects parameter 1 to be resource, bool given in /in/0Temo on line 22
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33
Warning: fopen(): Filename cannot be empty in /in/0Temo on line 5 Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'dedupe' not found or invalid function name in /in/0Temo on line 18 Warning: fwrite() expects parameter 1 to be resource, boolean given in /in/0Temo on line 21 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/0Temo on line 22

preferences:
224 ms | 403 KiB | 329 Q