3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function dedupe(array $foo) { return $foo; } // Input & Output Streams $input = fopen("php://stdin", "r"); $output = fopen("php://stdout","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);
based on 0Temo
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function dedupe(), 0 passed in /in/vtW5f on line 23 and exactly 1 expected in /in/vtW5f:3 Stack trace: #0 /in/vtW5f(23): dedupe() #1 {main} thrown in /in/vtW5f on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Fatal error: Uncaught TypeError: Argument 1 passed to dedupe() must be of the type array, none given, called in /in/vtW5f on line 23 and defined in /in/vtW5f:3 Stack trace: #0 /in/vtW5f(23): dedupe() #1 {main} thrown in /in/vtW5f on line 3
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Catchable fatal error: Argument 1 passed to dedupe() must be of the type array, none given in /in/vtW5f on line 3
Process exited with code 255.