3v4l.org

run code in 500+ PHP versions simultaneously
<?php $inputs = [ '44d', '5h 53s', '1d 3h 16m 2s', '2d 57m', '3m', '2m 22s', '6d 6s' ]; foreach ($inputs as $input) { preg_match('/^(?:(\d+)d ?)?(?:(\d+)h ?)?(?:(\d+)m ?)?(?:(\d+)s)?$/', $input, $m); echo "$input = " . ((int) ($m[1] ?? 0) * 86400) + ((int) ($m[2] ?? 0) * 3600) + ((int) ($m[3] ?? 0) * 60) + (int) ($m[4] ?? 0) . " seconds\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
44d = 3801600 seconds 5h 53s = 18053 seconds 1d 3h 16m 2s = 98162 seconds 2d 57m = 176220 seconds 3m = 180 seconds 2m 22s = 142 seconds 6d 6s = 518406 seconds

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:
56.87 ms | 1137 KiB | 4 Q