3v4l.org

run code in 500+ PHP versions simultaneously
<?php $cal = IntlCalendar::createInstance(); var_dump($cal->isWeekend(0)); $cal2 = unserialize(serialize($cal)); try { var_dump($cal2->isWeekend(0)); } catch (Error $e) { var_dump($e->getMessage()); } $formatter = new IntlDateFormatter(null, IntlDateFormatter::SHORT, IntlDateFormatter::SHORT); var_dump($formatter->format(0)); $formatter2 = unserialize(serialize($formatter)); try { var_dump($formatter2->format(0)); } catch (Error $e) { var_dump($e->getMessage()); }
Output for 8.5.1 - 8.5.13, 8.6.0
Fatal error: Uncaught Error: Class "IntlCalendar" not found in /in/MGLnU:3 Stack trace: #0 {main} thrown in /in/MGLnU on line 3
Process exited with code 255.
Output for 8.2.0 - 8.2.36, 8.3.0 - 8.3.37, 8.4.1 - 8.4.28, 8.5.0
bool(false) Fatal error: Uncaught Exception: Serialization of 'IntlGregorianCalendar' is not allowed in /in/MGLnU:6 Stack trace: #0 /in/MGLnU(6): serialize(Object(IntlGregorianCalendar)) #1 {main} thrown in /in/MGLnU on line 6
Process exited with code 255.
Output for 8.1.34
bool(false) string(32) "Found unconstructed IntlCalendar" string(17) "1/1/70, 1:00 AM" string(37) "Found unconstructed IntlDateFormatter"
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.33
bool(false) string(32) "Found unconstructed IntlCalendar" string(15) "1/1/70, 1:00 AM" string(37) "Found unconstructed IntlDateFormatter"
Output for 7.4.33
Fatal error: Uncaught Error: Class 'IntlCalendar' not found in /in/MGLnU:3 Stack trace: #0 {main} thrown in /in/MGLnU on line 3
Process exited with code 255.
Output for 7.4.0 - 7.4.32
bool(false) bool(false) string(15) "1/1/70, 1:00 AM" bool(false)

preferences:
30.16 ms | 1179 KiB | 6 Q