3v4l.org

run code in 300+ PHP versions simultaneously
<?php function oldFormatSeconds($ss) { $result = ''; $s = $ss % 60; $m = floor(($ss % 3600) / 60); $h = floor(($ss % 86400) / 3600); $d = floor(($ss % 2592000) / 86400); if ($d > 0) { $result .= $d . 'd, '; } if ($h > 0) { $result .= $h . 'h '; } if ($m > 0 || $s > 0) { $result .= $m . 'm '; } if ($s > 0) { $result .= $s . 's '; } return $result; } function formatSeconds($s) { return gmdate("H i s\s", 1000); } echo oldFormatSeconds(1000); echo "\n"; echo formatSeconds(1000);
Output for git.master, git.master_jit, rfc.property-hooks
16m 40s 00 16 40s

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:
60.78 ms | 401 KiB | 8 Q