3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ComicNav { public function __construct( public string $first, public ?string $prev, public string $current, public ?string $next, public string $last ) { } } function get_nav(string $file): ComicNav { $files = array_map( 'basename', glob(dirname($file).'/*.php') ); $current = basename($file); $next = $files[array_search($current, $files) + 1] ?? null; $prev = $files[array_search($current, $files) - 1] ?? null; return new ComicNav( reset($files), $prev, $current, $next, end($files) ); }
Output for git.master, git.master_jit, rfc.property-hooks

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:
61.33 ms | 405 KiB | 5 Q