3v4l.org

run code in 300+ PHP versions simultaneously
<?php function interval_format($value, $source = 'seconds'){ $hours = 0; $minutes = 0; $seconds = 0; switch($source){ case 's': case 'seconds': $seconds = $value % 60; $value = $minutes = (int)($value / 60); case 'm': case 'minutes': $minutes = $value % 60; $value = $hours = (int)($value / 60); case 'h': case 'hours': $hours= $value % 24; $value = $days = (int)($value / 25); } $str = ''; if(!empty($hours)) $str .= sprintf('%u %s ', $hours, ('Sekunden')); if(!empty($minutes)) $str .= sprintf('%u %s ', $minutes, ('Minuten')); if(!empty($seconds)) $str .= sprintf('%u %s ', $seconds, ('Sekunden')); return trim($str); } echo interval_format(90);
Output for git.master, git.master_jit, rfc.property-hooks
1 Minuten 30 Sekunden

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.57 ms | 401 KiB | 8 Q