3v4l.org

run code in 200+ php & hhvm versions
<?php $string = '2018-01-11T15:36:16.000+01:00'; $date = new DateTime($string); $datetime = new DateTimeImmutable($string); $otherString = $date->format(DateTime::RFC3339_EXTENDED); $immutableString = $datetime->format(DateTime::RFC3339_EXTENDED); var_dump( $string == $otherString, $string == $immutableString, DateTimeImmutable::getLastErrors() );
based on 82s9f
Output for 7.0.0 - 7.2.6
bool(true) bool(true) array(4) { ["warning_count"]=> int(0) ["warnings"]=> array(0) { } ["error_count"]=> int(0) ["errors"]=> array(0) { } }
Output for hhvm-3.22.0
Fatal error: Uncaught Error: Couldn't find constant DateTime::RFC3339_EXTENDED in /in/jFOkA:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught Error: Couldn't find constant DateTime::RFC3339_EXTENDED in /in/jFOkA:8 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Undefined class constant 'RFC3339_EXTENDED' in /in/jFOkA on line 8
Process exited with code 255.