3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $d1 = new \Datetime('2017-4-1'); $d2 = new \Datetime('2017-5-1'); $diff = $d1->diff($d2); echo sprintf('%d Month\\s', $diff->m) . PHP_EOL; echo sprintf('...But %d Day\\s', $diff->d) . PHP_EOL;
based on v7YR3
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
0 Month\s ...But 30 Day\s