3v4l.org

run code in 300+ PHP versions simultaneously
<?php $path = "/home/sjon/phpshell/root/php-5.5.0/lib/php/extensions/no-debug-non-zts-20121212"; $dir = dir($path); while (($entry = $dir->read()) !== false) { var_dump($entry); try { $file = new \SplFileObject($path. $entry, 'r'); } catch (Exception $e) { continue; } var_dump($file->isFile()); }
Output for 8.3.0 - 8.3.4
Warning: dir(): open_basedir restriction in effect. File(/home/sjon/phpshell/root/php-5.5.0/lib/php/extensions/no-debug-non-zts-20121212) is not within the allowed path(s): (/tmp:/in:/etc) in /in/K8kjn on line 3 Warning: dir(/home/sjon/phpshell/root/php-5.5.0/lib/php/extensions/no-debug-non-zts-20121212): Failed to open directory: Operation not permitted in /in/K8kjn on line 3 Fatal error: Uncaught Error: Call to a member function read() on false in /in/K8kjn:5 Stack trace: #0 {main} thrown in /in/K8kjn on line 5
Process exited with code 255.
Output for 8.0.14 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17
Warning: dir(): open_basedir restriction in effect. File(/home/sjon/phpshell/root/php-5.5.0/lib/php/extensions/no-debug-non-zts-20121212) is not within the allowed path(s): (/tmp:/in:/etc) in /in/K8kjn on line 3 Warning: dir(/home/sjon/phpshell/root/php-5.5.0/lib/php/extensions/no-debug-non-zts-20121212): Failed to open directory: Operation not permitted in /in/K8kjn on line 3 Fatal error: Uncaught Error: Call to a member function read() on bool in /in/K8kjn:5 Stack trace: #0 {main} thrown in /in/K8kjn on line 5
Process exited with code 255.
Output for 8.0.0 - 8.0.13
Warning: dir(/home/sjon/phpshell/root/php-5.5.0/lib/php/extensions/no-debug-non-zts-20121212): Failed to open directory: Permission denied in /in/K8kjn on line 3 Fatal error: Uncaught Error: Call to a member function read() on bool in /in/K8kjn:5 Stack trace: #0 {main} thrown in /in/K8kjn on line 5
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.25, 7.4.33
Warning: dir(/home/sjon/phpshell/root/php-5.5.0/lib/php/extensions/no-debug-non-zts-20121212): failed to open dir: Permission denied in /in/K8kjn on line 3 Fatal error: Uncaught Error: Call to a member function read() on bool in /in/K8kjn:5 Stack trace: #0 {main} thrown in /in/K8kjn on line 5
Process exited with code 255.
Output for 7.4.26 - 7.4.32
Warning: dir(): open_basedir restriction in effect. File(/home/sjon/phpshell/root/php-5.5.0/lib/php/extensions/no-debug-non-zts-20121212) is not within the allowed path(s): (/tmp:/in:/etc) in /in/K8kjn on line 3 Warning: dir(/home/sjon/phpshell/root/php-5.5.0/lib/php/extensions/no-debug-non-zts-20121212): failed to open dir: Operation not permitted in /in/K8kjn on line 3 Fatal error: Uncaught Error: Call to a member function read() on bool in /in/K8kjn:5 Stack trace: #0 {main} thrown in /in/K8kjn on line 5
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34
Warning: dir(/home/sjon/phpshell/root/php-5.5.0/lib/php/extensions/no-debug-non-zts-20121212): failed to open dir: Permission denied in /in/K8kjn on line 3 Fatal error: Uncaught Error: Call to a member function read() on boolean in /in/K8kjn:5 Stack trace: #0 {main} thrown in /in/K8kjn on line 5
Process exited with code 255.
Output for 5.6.0 - 5.6.40
Warning: dir(/home/sjon/phpshell/root/php-5.5.0/lib/php/extensions/no-debug-non-zts-20121212): failed to open dir: Permission denied in /in/K8kjn on line 3 Fatal error: Call to a member function read() on boolean in /in/K8kjn on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38
Warning: dir(/home/sjon/phpshell/root/php-5.5.0/lib/php/extensions/no-debug-non-zts-20121212): failed to open dir: Permission denied in /in/K8kjn on line 3 Fatal error: Call to a member function read() on a non-object in /in/K8kjn on line 5
Process exited with code 255.
Output for 5.2.3 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/K8kjn on line 8 Warning: dir(/home/sjon/phpshell/root/php-5.5.0/lib/php/extensions/no-debug-non-zts-20121212): failed to open dir: Permission denied in /in/K8kjn on line 3 Fatal error: Call to a member function read() on a non-object in /in/K8kjn on line 5
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.2
<br /> <b>Warning</b>: Unexpected character in input: '\' (ASCII=92) state=1 in <b>/in/K8kjn</b> on line <b>8</b><br /> <br /> <b>Warning</b>: dir(/home/sjon/phpshell/root/php-5.5.0/lib/php/extensions/no-debug-non-zts-20121212) [<a href='function.dir'>function.dir</a>]: failed to open dir: Permission denied in <b>/in/K8kjn</b> on line <b>3</b><br /> <br /> <b>Fatal error</b>: Call to a member function read() on a non-object in <b>/in/K8kjn</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.4.2 - 4.4.9
<br /> <b>Parse error</b>: syntax error, unexpected '{' in <b>/in/K8kjn</b> on line <b>7</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
<br /> <b>Parse error</b>: parse error, unexpected '{' in <b>/in/K8kjn</b> on line <b>7</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br /> <b>Parse error</b>: parse error in <b>/in/K8kjn</b> on line <b>7</b><br />
Process exited with code 255.

preferences:
301.02 ms | 401 KiB | 464 Q