3v4l.org

run code in 300+ PHP versions simultaneously
<?php $datestring = '2017-06-03T00:08:10.881UTCXX'; if ($date = date_create_from_format(DateTime::RFC3339_EXTENDED, $datestring)) { print_r($date); } else { print_r(date_get_last_errors()); } if ($date = date_create($datestring)) { print_r($date); } else { print_r(date_get_last_errors()); } if ($date = DateTime::createFromFormat(DateTime::RFC3339_EXTENDED, $datestring)) { print_r($date); } else { print_r(DateTime::getLastErrors()); } if ($date = new DateTime($datestring)) { print_r($date); } else { print_r(DateTime::getLastErrors()); } if ($date = DateTimeImmutable::createFromFormat(DateTimeImmutable::RFC3339_EXTENDED, $datestring)) { print_r($date); } else { print_r(DateTimeImmutable::getLastErrors()); } if ($date = new DateTimeImmutable($datestring)) { print_r($date); } else { print_r(DateTimeImmutable::getLastErrors()); }
Output for git.master, git.master_jit
Array ( [warning_count] => 0 [warnings] => Array ( ) [error_count] => 1 [errors] => Array ( [23] => The timezone could not be found in the database ) ) Array ( [warning_count] => 0 [warnings] => Array ( ) [error_count] => 1 [errors] => Array ( [23] => The timezone could not be found in the database ) ) Array ( [warning_count] => 0 [warnings] => Array ( ) [error_count] => 1 [errors] => Array ( [23] => The timezone could not be found in the database ) ) Fatal error: Uncaught Exception: Failed to parse time string (2017-06-03T00:08:10.881UTCXX) at position 23 (U): The timezone could not be found in the database in /in/sGC86:23 Stack trace: #0 /in/sGC86(23): DateTime->__construct('2017-06-03T00:0...') #1 {main} thrown in /in/sGC86 on line 23
Process exited with code 255.
Output for rfc.property-hooks
Array ( [warning_count] => 0 [warnings] => Array ( ) [error_count] => 1 [errors] => Array ( [23] => The timezone could not be found in the database ) ) Array ( [warning_count] => 0 [warnings] => Array ( ) [error_count] => 1 [errors] => Array ( [23] => The timezone could not be found in the database ) ) Array ( [warning_count] => 0 [warnings] => Array ( ) [error_count] => 1 [errors] => Array ( [23] => The timezone could not be found in the database ) ) Fatal error: Uncaught DateMalformedStringException: Failed to parse time string (2017-06-03T00:08:10.881UTCXX) at position 23 (U): The timezone could not be found in the database in /in/sGC86:23 Stack trace: #0 /in/sGC86(23): DateTime->__construct('2017-06-03T00:0...') #1 {main} thrown in /in/sGC86 on line 23
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
33.78 ms | 402 KiB | 8 Q