3v4l.org

run code in 300+ PHP versions simultaneously
<?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() );

preferences:
53.9 ms | 402 KiB | 5 Q