3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php Locale::setDefault('no_NO'); $fmt = new IntlDateFormatter( Locale::getDefault(), IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/Los_Angeles', IntlDateFormatter::GREGORIAN ); echo 'Formatted output is ' . $fmt->format(0)."\n"; Locale::setDefault('en_GB'); $fmt = new IntlDateFormatter( Locale::getDefault(), IntlDateFormatter::LONG , IntlDateFormatter::LONG , 'America/Los_Angeles', IntlDateFormatter::GREGORIAN ); echo 'Formatted output is ' . $fmt->parse(date("Y/mm/dd"))."\n"; echo "with DateTime:\n\t", IntlDateFormatter::formatObject( new DateTime(date("Y-mm-dd")), IntlDateFormatter::LONG, Locale::getDefault()), "\n";
based on b4V98
Output for 7.0.20 - 7.2.0
Formatted output is onsdag 31. desember 1969 16:00:00 normaltid for den nordamerikanske Stillehavskysten Formatted output is with DateTime: Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (2015-1010-2828) at position 7 (1): Unexpected character in /in/s6bCu:26 Stack trace: #0 /in/s6bCu(26): DateTime->__construct('2015-1010-2828') #1 {main} thrown in /in/s6bCu on line 26
Process exited with code 255.
Output for 7.0.0 - 7.0.8
Formatted output is onsdag 31. desember 1969 16.00.00 normaltid for den nordamerikanske Stillehavskysten Formatted output is with DateTime: Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (2015-1010-2828) at position 7 (1): Unexpected character in /in/s6bCu:26 Stack trace: #0 /in/s6bCu(26): DateTime->__construct('2015-1010-2828') #1 {main} thrown in /in/s6bCu on line 26
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Formatted output is onsdag 31. desember 1969 16.00.00 normaltid for den nordamerikanske Stillehavskysten Formatted output is with DateTime: Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (2015-1010-2828) at position 7 (1): Unexpected character' in /in/s6bCu:26 Stack trace: #0 /in/s6bCu(26): DateTime->__construct('2015-1010-2828') #1 {main} thrown in /in/s6bCu on line 26
Process exited with code 255.
Output for 5.4.0 - 5.4.45
Formatted output is onsdag 31. desember 1969 16.00.00 normaltid for den nordamerikanske Stillehavskysten Formatted output is with DateTime: Fatal error: Call to undefined method IntlDateFormatter::formatObject() in /in/s6bCu on line 25
Process exited with code 255.