3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php @error_reporting(E_ALL | E_STRICT); // NOT FOR PRODUCTION SERVERS! @ini_set('display_errors', '1'); require_once('functions.php'); global $argv; #TODO: check for number of arguments passed $zip_info = pathinfo($argv[1]); if ($zip_info["extension"] !== "zip") { echo "Incorrect file provided. Please provide .zip file.\n"; exit(); } #TODO: check if user provided valid directory $copy_to_folders = get_folders($argv[2]); var_dump($argv); $zip_file = $argv[1]; echo $zip_file; $zip_parts = explode('.', $zip_file); $zip_name = $zip_parts[0]; $path_to_zip = pathinfo(realpath($zip_file), PATHINFO_DIRNAME); $zip = new ZipArchive; var_dump($zip); $result = $zip->open($zip_file); var_dump($result); if ($result === true) { $zip->extractTo($path_to_zip); $zip->close(); echo "success \n"; } function get_folders($path) { if(!is_dir($path)){ echo "ERROR: $path isn't a directory. Please provide valid directory for path.\n"; exit(); } $browsers = array(); if ($handle = opendir($path)) { chdir($path); $current_dir = getcwd(); while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != "..") { $browser = $current_dir . "/" . $entry; $browsers[] = $browser; } } closedir($handle); } return $browsers; }
Output for 5.1.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: require_once(functions.php): failed to open stream: No such file or directory in /in/2KIeU on line 5 Fatal error: require_once(): Failed opening required 'functions.php' (include_path='.:') in /in/2KIeU on line 5
Process exited with code 255.
Output for hhvm-3.12.0
Fatal error: File not found: functions.php in /in/2KIeU on line 5
Process exited with code 255.
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.2 - 5.0.5
Warning: main(functions.php): failed to open stream: No such file or directory in /in/2KIeU on line 5 Fatal error: main(): Failed opening required 'functions.php' (include_path='.:') in /in/2KIeU on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: main(functions.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /in/2KIeU on line 5 Fatal error: main() [http://www.php.net/function.main]: Failed opening required 'functions.php' (include_path='.:') in /in/2KIeU on line 5