3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'http://localhost/img'; $dir = 'C:\Program Files\Apache Group\Apache2\htdocs\img'; $max = 5; $images = preg_grep('/\.(?:jpe?g|gif|png)\z/i', scandir($dir)); array_walk($images, function (&$v) { $v = $url . $v; }); ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> <h1><?=$path?>内の画像一覧</h1> <?php if (!$images): ?> <p>表示する画像はありません</p> <?php else: ?> <table> <tr> <?php foreach ($images as $i => $img): ?> <?php if ($i !== 0 && $i % $max === 0): ?> </tr> <tr> <?php endif; ?> <td><img src="<?=$img?>"></td> <?php endforeach; ?> </tr> </table> <?php endif; ?> </body> </html>
Output for git.master, git.master_jit
Warning: scandir(): open_basedir restriction in effect. File(C:\Program Files\Apache Group\Apache2\htdocs\img) is not within the allowed path(s): (/tmp:/in:/etc) in /in/uI4VA on line 7 Warning: scandir(C:\Program Files\Apache Group\Apache2\htdocs\img): Failed to open directory: Operation not permitted in /in/uI4VA on line 7 Warning: scandir(): (errno 1): Operation not permitted in /in/uI4VA on line 7 Fatal error: Uncaught TypeError: preg_grep(): Argument #2 ($array) must be of type array, bool given in /in/uI4VA:7 Stack trace: #0 /in/uI4VA(7): preg_grep('/\\.(?:jpe?g|gif...', false) #1 {main} thrown in /in/uI4VA on line 7
Process exited with code 255.
Output for rfc.property-hooks
Warning: scandir(): open_basedir restriction in effect. File(C:\Program Files\Apache Group\Apache2\htdocs\img) is not within the allowed path(s): (/tmp:/in:/etc) in /in/uI4VA on line 7 Warning: scandir(C:\Program Files\Apache Group\Apache2\htdocs\img): Failed to open directory: Operation not permitted in /in/uI4VA on line 7 Warning: scandir(): (errno 1): Operation not permitted in /in/uI4VA on line 7 Fatal error: Uncaught TypeError: preg_grep(): Argument #2 ($array) must be of type array, false given in /in/uI4VA:7 Stack trace: #0 /in/uI4VA(7): preg_grep('/\\.(?:jpe?g|gif...', false) #1 {main} thrown in /in/uI4VA on line 7
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:
49.3 ms | 401 KiB | 8 Q