3v4l.org

run code in 300+ PHP versions simultaneously
<?php function listFolderFiles($dir){ $ffs = scandir($dir); unset($ffs[array_search('.', $ffs, true)]); unset($ffs[array_search('..', $ffs, true)]); // prevent empty ordered elements if (count($ffs) < 1) return; echo '<ol>'; foreach($ffs as $ff){ echo '<li>'.$ff; if(is_dir($dir.'/'.$ff)) listFolderFiles($dir.'/'.$ff); echo '</li>'; } echo '</ol>'; } listFolderFiles('./');
Output for git.master, git.master_jit, rfc.property-hooks
Warning: scandir(): open_basedir restriction in effect. File(./) is not within the allowed path(s): (/tmp:/in:/etc) in /in/VsQLb on line 3 Warning: scandir(./): Failed to open directory: Operation not permitted in /in/VsQLb on line 3 Warning: scandir(): (errno 1): Operation not permitted in /in/VsQLb on line 3 Fatal error: Uncaught TypeError: array_search(): Argument #2 ($haystack) must be of type array, false given in /in/VsQLb:5 Stack trace: #0 /in/VsQLb(5): array_search('.', false, true) #1 /in/VsQLb(21): listFolderFiles('./') #2 {main} thrown in /in/VsQLb on line 5
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:
42.69 ms | 402 KiB | 8 Q