3v4l.org

run code in 300+ PHP versions simultaneously
<?php function checkAisle($term) { if (!ctype_alpha($term[0])) { return "First character out of bounds"; } $locations = array_fill_keys(range('A','L'),1)+array_fill_keys(range('M','Z'),2); $letter = strtoupper($term[0]); return "$letter is located on Aisle {$locations[$letter]}."; } echo checkAisle("Trump") , "\n"; echo checkAisle("banana") , "\n"; echo checkAisle("melon") , "\n"; echo checkAisle("guava") , "\n"; echo checkAisle("nectarine") , "\n"; echo checkAisle("lemon") , "\n";
Output for git.master, git.master_jit, rfc.property-hooks
T is located on Aisle 2. B is located on Aisle 1. M is located on Aisle 2. G is located on Aisle 1. N is located on Aisle 2. L is located on Aisle 1.

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