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 7.2.12 - 7.3.0
string(7) "05:1:37"
Output for 5.5.0 - 7.2.11
string(7) "05:1:38"
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"