3v4l.org

run code in 500+ PHP versions simultaneously
<?php $locale = "es_MX"; $shortDatePattern = "dd/MM/yy"; $in_date = "4/4/23"; $timezone = "America/Mexico_City"; date_default_timezone_set($timezone); $fmt = new IntlDateFormatter($locale,IntlDateFormatter::SHORT,IntlDateFormatter::NONE); $fmt->setPattern($shortDatePattern); $timestamp = $fmt->parse($in_date); echo gmdate('Y-m-d H:i:s', $timestamp) . "\n"; echo date('Y-m-d H:i:s', $timestamp) . "\n"; echo $timestamp . "\n"; echo date_default_timezone_get() . "\n";
Output for 8.5.1 - 8.5.11
Fatal error: Uncaught Error: Class "IntlDateFormatter" not found in /in/5ha27:9 Stack trace: #0 {main} thrown in /in/5ha27 on line 9
Process exited with code 255.
Output for 8.0.26 - 8.0.30, 8.1.13 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
2023-04-04 05:00:00 2023-04-03 23:00:00 1680584400 America/Mexico_City
Output for 8.0.1 - 8.0.25, 8.1.0 - 8.1.12
2023-04-04 05:00:00 2023-04-04 00:00:00 1680584400 America/Mexico_City
Output for 8.1.34, 8.2.30 - 8.2.34, 8.3.28 - 8.3.35, 8.4.15 - 8.4.26, 8.5.0
2023-04-04 06:00:00 2023-04-04 00:00:00 1680588000 America/Mexico_City

preferences:
46.47 ms | 1174 KiB | 28 Q