3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_files($path){ $folder = opendir($path); while ($dat = readdir($folder)){ if ($dat != "." && $dat != ".." && (is_dir($path."/".$dat) || substr($dat,-3) == "jpg" || substr($dat,-3) == "gif" || substr($dat,-3) == "bmp" || substr($dat,-3) == "png")){ if (is_dir($path."/".$dat)){ $dirs[] = get_files($path."/".$dat); } else{ $files[] = $path."/".$dat; } } } for ($i=0; $i<sizeof($dirs); $i++){ $files2 = array_merge($files2,$dirs[$i]); } $array = array_merge($files,$files2); return $array; } $path = "http://www.hi-web.ch/"; // Pfad zum Startverzeichnis $amount = sizeof(get_files($path)); for ($i=0; $i < $amount; $i++){ $files = get_files($path); $size += filesize($files[$i]); }
Output for git.master, git.master_jit
Warning: opendir(http://www.hi-web.ch/): Failed to open directory: not implemented in /in/Vk1vB on line 3 Fatal error: Uncaught TypeError: readdir(): Argument #1 ($dir_handle) must be of type resource or null, bool given in /in/Vk1vB:4 Stack trace: #0 /in/Vk1vB(4): readdir(false) #1 /in/Vk1vB(28): get_files('http://www.hi-w...') #2 {main} thrown in /in/Vk1vB on line 4
Process exited with code 255.
Output for rfc.property-hooks
Warning: opendir(http://www.hi-web.ch/): Failed to open directory: not implemented in /in/Vk1vB on line 3 Fatal error: Uncaught TypeError: readdir(): Argument #1 ($dir_handle) must be of type resource or null, false given in /in/Vk1vB:4 Stack trace: #0 /in/Vk1vB(4): readdir(false) #1 /in/Vk1vB(28): get_files('http://www.hi-w...') #2 {main} thrown in /in/Vk1vB on line 4
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
51.81 ms | 401 KiB | 8 Q