3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $creationTime = \DateTimeImmutable::createFromFormat('Y-m-d H:i:s', '2017-07-10 10:00:00'); $expirationTime = \DateTimeImmutable::createFromFormat('Y-m-d H:i:s', '2017-07-10 11:00:00'); $time = $creationTime->diff($expirationTime); var_dump($time->format('s'));
based on ABHSO
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.6
string(1) "s"