3v4l.org

run code in 300+ PHP versions simultaneously
<?php $year = 2022; $formatter = new IntlDateFormatter( 'zh-CN@calendar=chinese', IntlDateFormatter::SHORT, IntlDateFormatter::NONE, 'Europe/Berlin', IntlDateFormatter::TRADITIONAL ); $timeStamp = $formatter->parse($year.'/01/01'); $dateTime = date_create()->setTimeStamp($timeStamp); echo $dateTime->format('j F Y'); //1 February 2022
Output for 8.5.1 - 8.5.3
Fatal error: Uncaught Error: Class "IntlDateFormatter" not found in /in/Fi1jL:3 Stack trace: #0 {main} thrown in /in/Fi1jL on line 3
Process exited with code 255.
Output for 7.2.34, 7.4.0 - 7.4.33, 8.0.0 - 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
1 February 2022

preferences:
79.69 ms | 1250 KiB | 4 Q