3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dateSuffix(int $x): string { $s = [0,"st","nd","rd"]; return (in_array($x,[1,2,3,21,22,23,31])) ? $s[$x % 10] : "th"; } function ordinal_suffix_match(int $value): string { return match ($value % 100) { 1, 21, 31, 41, 51, 61, 71, 81, 91 => 'st', 2, 22, 32, 42, 52, 62, 72, 82, 92 => 'nd', 3, 23, 33, 43, 53, 63, 73, 83, 93 => 'rd', default => 'th', }; }
Output for git.master_jit, git.master

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