3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Documented in the interface. function formatDuration($locale, $duration) { $rule = " %with-words: 0: 0 seconds; 1: 1 second; 2: =#0= seconds; 60/60: <%%min<; 61/60: <%%min<, >%with-words>; 3600/60: <%%hr<; 3601/60: <%%hr<, >%with-words>; 86400/86400: <%%day<; 86401/86400: <%%day<, >%with-words>; 604800/604800: <%%week<; 604801/604800: <%%week<, >%with-words>; %%min: 1: 1 minute; 2: =#0= minutes; %%hr: 1: 1 hour; 2: =#0= hours; %%day: 1: 1 day; 2: =#0= days; %%week: 1: 1 week; 2: =#0= weeks; "; $fmt = new NumberFormatter($locale, NumberFormatter::PATTERN_RULEBASED, $rule); return $fmt->format($duration); } formatDuration('en_US', 12345); formatDuration('fr_CA', 12345);
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:
42.31 ms | 401 KiB | 8 Q