3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $datetimes = [ '2014-10-05T01:59:59', '2014-10-05T02:00:00', '2014-10-05T02:59:59', '2014-10-05T03:00:00' ]; foreach ($datetimes as $datetime) { $dt = new DateTime($datetime, new DateTimeZone('Australia/Sydney')); echo $dt; echo $dt->format(DateTime::ISO8601) . PHP_EOL; }
based on KfPaK
Output for 7.1.0 - 7.2.0
Recoverable fatal error: Object of class DateTime could not be converted to string in /in/Kt98p on line 11
Process exited with code 255.
Output for 5.4.0 - 7.0.20
Catchable fatal error: Object of class DateTime could not be converted to string in /in/Kt98p on line 11
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/Kt98p on line 2
Process exited with code 255.