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 9gg5k
Output for 5.6.28, 7.0.20 - 7.2.0
string(7) "05:1:38"
Output for 7.0.6
string(8) "10:50:11"
Output for 7.0.5
string(8) "14:46:54"
Output for 7.0.4
string(8) "02:40:49"
Output for 7.0.3
string(8) "01:18:30"
Output for 7.0.2
string(7) "19:5:12"
Output for 7.0.1
string(8) "15:56:29"
Output for 7.0.0
string(7) "14:3:14"
Output for 5.6.21
string(8) "07:54:15"
Output for 5.6.20
string(7) "15:45:5"
Output for 5.6.19
string(8) "18:33:13"
Output for 5.6.18
string(7) "09:37:4"
Output for 5.6.17
string(6) "22:5:2"
Output for 5.6.16
string(8) "13:13:44"
Output for 5.6.15
string(8) "12:24:44"
Output for 5.6.14
string(8) "06:42:29"
Output for 5.6.13
string(7) "06:3:25"
Output for 5.6.12
string(8) "15:34:25"
Output for 5.6.11
string(7) "09:8:40"
Output for 5.6.10
string(7) "07:2:59"
Output for 5.6.9
string(8) "01:45:37"
Output for 5.6.8
string(6) "17:6:6"
Output for 5.5.35
string(8) "22:18:25"
Output for 5.5.34
string(8) "13:31:30"
Output for 5.5.33
string(7) "15:34:9"
Output for 5.5.32
string(7) "05:41:7"
Output for 5.5.31
string(8) "18:56:24"
Output for 5.5.30
string(8) "10:32:20"
Output for 5.5.29
string(8) "15:45:26"
Output for 5.5.28
string(7) "12:16:7"
Output for 5.5.27
string(8) "10:36:49"
Output for 5.5.26
string(8) "04:22:13"
Output for 5.5.25
string(8) "20:57:36"
Output for 5.5.24
string(7) "07:9:32"
Output for 5.4.45
string(7) "05:1:36"
Output for 5.4.44
string(7) "05:1:35"
Output for 5.4.41 - 5.4.43
string(7) "05:1:34"
Output for 5.4.38 - 5.4.40
string(7) "05:1:33"
Output for 5.4.34 - 5.4.37
string(7) "05:1:32"
Output for 5.3.29, 5.4.28 - 5.4.32
string(7) "05:1:31"
Output for 5.3.28, 5.4.23 - 5.4.27
string(7) "05:1:30"
Output for 5.3.27, 5.4.18 - 5.4.22
string(7) "05:1:29"
Output for 5.3.21 - 5.3.26, 5.4.12 - 5.4.17
string(7) "05:1:28"
Output for 5.4.11
string(7) "05:1:27"