3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $endDate = new DateTime(); $midnight = clone $endDate; $midnight->setTime(24, 0, 0); $difference = $midnight->diff($endDate); var_dump($difference->format('%H:%I:%S'));
based on RHUb8
Output for 5.6.28, 7.0.20 - 7.2.0
string(8) "04:58:09"
Output for 7.0.6
string(8) "10:50:04"
Output for 7.0.5
string(8) "14:46:49"
Output for 7.0.4
string(8) "02:40:42"
Output for 7.0.3
string(8) "01:18:24"
Output for 7.0.2
string(8) "19:05:04"
Output for 7.0.1
string(8) "15:56:23"
Output for 7.0.0
string(8) "14:03:08"
Output for 5.6.21
string(8) "07:54:09"
Output for 5.6.20
string(8) "15:44:57"
Output for 5.6.19
string(8) "18:33:07"
Output for 5.6.18
string(8) "09:36:57"
Output for 5.6.17
string(8) "22:04:57"
Output for 5.6.16
string(8) "13:13:37"
Output for 5.6.15
string(8) "12:24:38"
Output for 5.6.14
string(8) "06:42:23"
Output for 5.6.13
string(8) "06:03:19"
Output for 5.6.12
string(8) "15:34:20"
Output for 5.6.11
string(8) "09:08:34"
Output for 5.6.10
string(8) "07:02:54"
Output for 5.6.9
string(8) "01:45:31"
Output for 5.6.8
string(8) "17:06:01"
Output for 5.5.35
string(8) "22:18:18"
Output for 5.5.34
string(8) "13:31:24"
Output for 5.5.33
string(8) "15:34:04"
Output for 5.5.32
string(8) "05:40:59"
Output for 5.5.31
string(8) "18:56:18"
Output for 5.5.30
string(8) "10:32:14"
Output for 5.5.29
string(8) "15:45:20"
Output for 5.5.28
string(8) "12:16:01"
Output for 5.5.27
string(8) "10:36:44"
Output for 5.5.26
string(8) "04:22:07"
Output for 5.5.25
string(8) "20:57:30"
Output for 5.5.24
string(8) "14:33:07"
Output for 5.4.45
string(8) "04:58:07"
Output for 5.4.43 - 5.4.44
string(8) "04:58:06"
Output for 5.4.40 - 5.4.42
string(8) "04:58:05"
Output for 5.4.37 - 5.4.39
string(8) "04:58:04"
Output for 5.4.34 - 5.4.36
string(8) "04:58:03"
Output for 5.3.29, 5.4.27 - 5.4.32
string(8) "04:58:02"
Output for 5.3.28, 5.4.21 - 5.4.26
string(8) "04:58:01"
Output for 5.3.26 - 5.3.27, 5.4.17 - 5.4.20
string(8) "04:58:00"
Output for 5.3.21 - 5.3.25, 5.4.12 - 5.4.16
string(8) "04:57:59"
Output for 5.4.11
string(8) "04:57:58"