3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $tz = new DateTimeZone('Europe/Amsterdam'); $now = new DateTime('2015-10-01', $tz); $then = new DateTime('2015-01-01', $tz); $diff = $now->diff($then); echo $diff;
based on vpke1
Output for 7.1.0 - 7.2.0
Recoverable fatal error: Object of class DateInterval could not be converted to string in /in/n4oSI on line 9
Process exited with code 255.
Output for 5.3.18 - 7.0.20
Catchable fatal error: Object of class DateInterval could not be converted to string in /in/n4oSI on line 9
Process exited with code 255.