3v4l.org

run code in 500+ PHP versions simultaneously
<?php print "No keywords return: "; var_dump(Locale::getKeywords('en')); print "\nNo locale specified use the default, which doesn't usually have keywords. Returns: "; var_dump(Locale::getKeywords('')); print "\nBut it could, so worth mentioning the argument default. Returns: "; Locale::setDefault('sl-Latn-IT-nedis@currency=EUR;collation=PHONEBOOK'); var_dump(Locale::getKeywords('')); print "\nThe INTL_MAX_LOCALE_LEN is: " . INTL_MAX_LOCALE_LEN; $long_locale = 'sl-Latn-IT-nedis@currency=EUR;collation=PHONEBOOK;calendar=islamic-umalqura;numbers=hansfin;foo=lorumipsumsedutperspiciatisundeomnisistenatuserrorsitlorumip'; print "\nSo a string of " . strlen($long_locale) . " returns: "; var_dump(Locale::getKeywords($long_locale)); $longer_locale = 'sl-Latn-IT-nedis@currency=EUR;collation=PHONEBOOK;calendar=islamic-umalqura;numbers=hansfin;foo=lorumipsumsedutperspiciatisundeomnisistenatuserrorsitlorumips'; print "But a string of " . strlen($longer_locale) . " returns: "; var_dump(Locale::getKeywords($longer_locale)); $keyword = 'lorumipsumsedutperspiciatisundeomnisistenatuserrorsitlorumipslorumipsumsedutperspiciatisundeomnisistenatuserrorsit'; print "\nJust one keyword value with a max length longer than 100? (" . strlen($keyword) . ") Returns: "; $keyword_locale = 'sl-Latn-IT-nedis@cfoo=' . $keyword; var_dump(Locale::getKeywords($keyword_locale)); print "\nJust one keyword key with a max length longer than 100? (" . strlen($keyword) . ") Returns: "; $keyword_locale = 'sl-Latn-IT-nedis@' . $keyword . '=foo'; var_dump(Locale::getKeywords($keyword_locale));
Output for rfc.property-hooks, git.master_jit, git.master
No keywords return: NULL No locale specified use the default, which doesn't usually have keywords. Returns: NULL But it could, so worth mentioning the argument default. Returns: array(2) { ["collation"]=> string(9) "PHONEBOOK" ["currency"]=> string(3) "EUR" } The INTL_MAX_LOCALE_LEN is: 156 So a string of 156 returns: array(5) { ["calendar"]=> string(16) "islamic-umalqura" ["collation"]=> string(9) "PHONEBOOK" ["currency"]=> string(3) "EUR" ["foo"]=> string(60) "lorumipsumsedutperspiciatisundeomnisistenatuserrorsitlorumip" ["numbers"]=> string(7) "hansfin" } But a string of 157 returns: NULL Just one keyword value with a max length longer than 100? (114) Returns: array(1) { ["cfoo"]=> string(114) "lorumipsumsedutperspiciatisundeomnisistenatuserrorsitlorumipslorumipsumsedutperspiciatisundeomnisistenatuserrorsit" } Just one keyword key with a max length longer than 100? (114) Returns: NULL

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
56.85 ms | 3129 KiB | 4 Q