3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $intlDateFormatter = new IntlDateFormatter( 'en_US', IntlDateFormatter::MEDIUM, IntlDateFormatter::NONE, 'Asia/Nicosia', IntlDateFormatter::GREGORIAN, 'yyyy-MM-dd HH' ); $intlDateFormatter->setLenient(false); $date = '1990-03-24 01'; $res = $intlDateFormatter->parse($date); echo "$date - $res\n"; // 1990-03-24 - 638229600 $date = '1990-03-25 01'; //$intlDateFormatter->setLenient(true); $res = $intlDateFormatter->parse($date, $pos); var_dump($res); var_dump($pos); var_dump($intlDateFormatter->getErrorCode()); var_dump($intlDateFormatter->getErrorMessage()); echo "$date - $res\n"; // 1990-03-25 - $date = '1990-03-26 01'; $res = $intlDateFormatter->parse($date); echo "$date - $res\n"; // 1990-03-26 - 638398800
based on 7Kbdb
Output for hhvm-3.10.1 - 3.22.0, 7.2.0 - 7.2.12
1990-03-24 01 - 638233200 int(638316000) int(13) int(0) string(12) "U_ZERO_ERROR" 1990-03-25 01 - 638316000 1990-03-26 01 - 638402400
Output for 5.5.17, 5.6.0 - 5.6.38, 7.0.0 - 7.1.24
1990-03-24 01 - 638233200 int(638316000) NULL int(0) string(12) "U_ZERO_ERROR" 1990-03-25 01 - 638316000 1990-03-26 01 - 638402400
Output for 5.3.18 - 5.5.16, 5.5.18 - 5.5.38
Fatal error: Class 'IntlDateFormatter' not found in /in/APnNV on line 3
Process exited with code 255.