3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '2022-09-30T21:39:25.220185123Z'; $date = date_create_from_format( "Y-m-d\TH:i:s.u???P" , $string); var_dump($date);
Output for 5.6.0, 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-09-30 21:39:25.220185" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "Z" }

preferences:
93.43 ms | 1271 KiB | 4 Q