3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $now = new DateTime(); $midnight = clone $now; $midnight ->add(new DateInterval('P1D')) ->setTime(0, 0, 0) ; $difference = $midnight->diff($now); var_dump($difference->format('%H:%I:%S'));
based on 6KHsV
Output for 5.6.28, 7.0.20 - 7.2.0
string(8) "05:01:11"
Output for 7.0.6
string(8) "10:49:57"
Output for 7.0.5
string(8) "14:46:50"
Output for 7.0.4
string(8) "02:40:44"
Output for 7.0.3
string(8) "01:18:25"
Output for 7.0.2
string(8) "19:05:05"
Output for 7.0.1
string(8) "15:56:24"
Output for 7.0.0
string(8) "14:03:10"
Output for 5.6.21
string(8) "07:54:02"
Output for 5.6.20
string(8) "15:45:01"
Output for 5.6.19
string(8) "18:33:08"
Output for 5.6.18
string(8) "09:36:58"
Output for 5.6.17
string(8) "22:04:58"
Output for 5.6.16
string(8) "13:13:39"
Output for 5.6.15
string(8) "12:24:40"
Output for 5.6.14
string(8) "06:42:16"
Output for 5.6.13
string(8) "06:03:12"
Output for 5.6.12
string(8) "15:34:13"
Output for 5.6.11
string(8) "09:08:27"
Output for 5.6.10
string(8) "07:02:37"
Output for 5.6.9
string(8) "01:45:23"
Output for 5.6.8
string(8) "17:05:55"
Output for 5.5.35
string(8) "22:18:10"
Output for 5.5.34
string(8) "13:31:26"
Output for 5.5.33
string(8) "15:34:05"
Output for 5.5.32
string(8) "05:41:01"
Output for 5.5.31
string(8) "18:56:19"
Output for 5.5.30
string(8) "10:32:16"
Output for 5.5.29
string(8) "15:45:13"
Output for 5.5.28
string(8) "12:15:55"
Output for 5.5.27
string(8) "10:36:37"
Output for 5.5.26
string(8) "04:22:00"
Output for 5.5.25
string(8) "20:57:22"
Output for 5.5.24
string(8) "14:33:05"
Output for 5.4.44 - 5.4.45
string(8) "05:01:09"
Output for 5.4.43
string(8) "05:01:08"
Output for 5.4.40 - 5.4.42
string(8) "05:01:07"
Output for 5.4.36 - 5.4.39
string(8) "05:01:06"
Output for 5.3.29, 5.4.31 - 5.4.35
string(8) "05:01:05"
Output for 5.4.25 - 5.4.30
string(8) "05:01:04"
Output for 5.3.28, 5.4.20 - 5.4.24
string(8) "05:01:03"
Output for 5.3.25 - 5.3.27, 5.4.15 - 5.4.19
string(8) "05:01:02"
Output for 5.3.21 - 5.3.24, 5.4.11 - 5.4.14
string(8) "05:01:01"