3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '2022-09-30T21:39:25.220185674Z'; $d = new DateTime($str); var_dump($d);
Output for 8.0.10 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-09-30 21:39:25.220185" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "Z" }
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.9
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (2022-09-30T21:39:25.220185674Z) at position 0 (2): The timezone could not be found in the database in /in/pI4kO:4 Stack trace: #0 /in/pI4kO(4): DateTime->__construct('2022-09-30T21:3...') #1 {main} thrown in /in/pI4kO on line 4
Process exited with code 255.

preferences:
124.29 ms | 408 KiB | 5 Q