3v4l.org

run code in 200+ PHP versions simultaneously
<?php $a = new DateTime("2017-11-17 22:05:26.000000", new DateTimeZone('UTC')); $b = new DateTime("2017-04-03 22:29:15.079459", new DateTimeZone('UTC')); $diff = $a->diff($b); var_dump($diff->h); // Africa/Nairobi has no DST $a = new DateTime("2017-11-17 22:05:26.000000", new DateTimeZone('Africa/Nairobi')); $b = new DateTime("2017-04-03 22:29:15.079459", new DateTimeZone('Africa/Nairobi')); $diff = $a->diff($b); var_dump($diff->h);
based on mKWWA
Output for 5.6.0 - 7.3.1
int(23) int(23)