3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php \Locale::setDefault('nl-NL'); var_dump(\Locale::getDisplayName('nl-NL', null)); var_dump(\Locale::getDisplayName('nl-NL', \Locale::getDefault())); var_dump(\Locale::getDisplayRegion('-NL', null)); var_dump(\Locale::getDisplayRegion('-NL', \Locale::getDefault()));
based on j0s3F
Output for 5.4.0 - 5.4.45, 5.6.0 - 5.6.30, 7.0.0 - 7.2.2
string(7) "nl (NL)" string(22) "Nederlands (Nederland)" string(2) "NL" string(9) "Nederland"
Output for hhvm-3.10.1, hhvm-3.20.2 - 3.22.0
string(22) "Nederlands (Nederland)" string(22) "Nederlands (Nederland)" string(9) "Nederland" string(9) "Nederland"
Output for hhvm-3.11.1 - 3.19.2
Warning: getDisplayName() expects parameter 2 to be string, null given in /in/mIf1N on line 4 NULL string(22) "Nederlands (Nederland)" Warning: getDisplayRegion() expects parameter 2 to be string, null given in /in/mIf1N on line 7 NULL string(9) "Nederland"
Output for 5.3.0 - 5.3.29, 5.5.0 - 5.5.38
Fatal error: Class 'Locale' not found in /in/mIf1N on line 3
Process exited with code 255.
Output for 5.0.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 5 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 5 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 7 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 8 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 8 Fatal error: Class 'Locale' not found in /in/mIf1N on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 5 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 5 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 7 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 8 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 8 Fatal error: Undefined class name 'locale' in /in/mIf1N on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 5 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 5 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 7 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 8 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/mIf1N on line 8 Fatal error: Undefined class name 'locale' in /in/mIf1N on line 3