3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(Locale::parseLocale('cs_cz')); var_dump(Locale::parseLocale('cs_Latn_CZ_VAR1_VAR2_X_PRI1_PRI2@calendar=iso8601;colbackwards=yes;colcasefirst=lower;collation=phonebook;currency=CZK;numbers=arab'));
Output for 5.6.0 - 5.6.27, 7.0.0 - 7.0.13, 7.1.18 - 7.1.33, 7.2.6 - 7.2.33, 7.3.0 - 7.3.28, 7.4.0 - 7.4.16, 8.0.0 - 8.0.3
array(2) { ["language"]=> string(2) "cs" ["region"]=> string(2) "CZ" } array(7) { ["language"]=> string(2) "cs" ["script"]=> string(4) "Latn" ["region"]=> string(2) "CZ" ["variant0"]=> string(4) "VAR1" ["variant1"]=> string(4) "VAR2" ["private0"]=> string(4) "PRI1" ["private1"]=> string(103) "PRI2@calendar=iso8601;colbackwards=yes;colcasefirst=lower;collation=phonebook;currency=CZK;numbers=arab" }
Output for 5.6.28 - 5.6.40, 7.0.14 - 7.0.33, 7.1.0 - 7.1.17, 7.2.0 - 7.2.5
array(2) { ["language"]=> string(2) "cs" ["region"]=> string(2) "CZ" } NULL