3v4l.org

run code in 300+ PHP versions simultaneously
<?php function execute($pageNumber, $pageHeight){ $commands = [ "foo" => ["name" => "foo", "desc" => "Foo Desc"], "fuu" => ["name" => "fuu", "desc" => "Fuu Desc"], "bar" => ["name" => "bar", "desc" => "Bar Desc"], "baa" => ["name" => "baa", "desc" => "Baa Desc"], "blah" => ["name" => "blah", "desc" => "Blah Desc"], "fool" => ["name" => "fool", "desc" => "Fool Desc"], "boof" => ["name" => "boof", "desc" => "boof Desc"], ]; ksort($commands, SORT_NATURAL | SORT_FLAG_CASE); $commands = array_chunk($commands, $pageHeight); $pageNumber = (int) min(count($commands), $pageNumber); printf("PageNumber=%d, CountCommands=%d\n", $pageNumber, count($commands)); foreach($commands[$pageNumber - 1] as $command){ printf("Name=%s, Desc=%s\n", $command["name"], $command["desc"]); } } execute(1, 3); echo "===\n\n"; execute(2, 3); echo "===\n\n"; execute(3, 3);
Output for git.master, git.master_jit, rfc.property-hooks
PageNumber=1, CountCommands=3 Name=baa, Desc=Baa Desc Name=bar, Desc=Bar Desc Name=blah, Desc=Blah Desc === PageNumber=2, CountCommands=3 Name=boof, Desc=boof Desc Name=foo, Desc=Foo Desc Name=fool, Desc=Fool Desc === PageNumber=3, CountCommands=3 Name=fuu, Desc=Fuu Desc

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:
136.72 ms | 406 KiB | 5 Q