3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php setlocale (LC_COLLATE, 'si'); $m = array('Žunko', 'Červ', 'Milanka', 'Bojanja'); var_dump($m); sort($m, SORT_LOCALE_STRING); var_dump($m); $coll = collator_create('sl_SL'); $coll->sort($m); var_dump($m);
based on fQsTI
Output for 5.4.10 - 5.5.28, 5.5.31 - 5.5.33, 5.5.35 - 5.6.12, 5.6.16 - 5.6.19, 5.6.21 - 7.0.4, 7.0.6 - 7.2.0
array(4) { [0]=> string(6) "Žunko" [1]=> string(5) "Červ" [2]=> string(7) "Milanka" [3]=> string(7) "Bojanja" } array(4) { [0]=> string(7) "Bojanja" [1]=> string(7) "Milanka" [2]=> string(5) "Červ" [3]=> string(6) "Žunko" } array(4) { [0]=> string(7) "Bojanja" [1]=> string(5) "Červ" [2]=> string(7) "Milanka" [3]=> string(6) "Žunko" }
Output for 7.0.5
array(4) { [0]=> string(6) "Žunko" [1]=> string(5) "Červ" [2]=> string(7) "Milanka" [3]=> string(7) "Bojanja" } array(4) { [0]=> string(7) "Bojanja" [1]=> string(7) "Milanka" [2]=> string(5) "Červ" [3]=> string(6) "Žunko" } Fatal error: Uncaught Error: Call to undefined function collator_create() in /in/c1VuR:10 Stack trace: #0 {main} thrown in /in/c1VuR on line 10
Process exited with code 255.
Output for 5.3.20 - 5.3.29, 5.5.29 - 5.5.30, 5.5.34, 5.6.13 - 5.6.15, 5.6.20
array(4) { [0]=> string(6) "Žunko" [1]=> string(5) "Červ" [2]=> string(7) "Milanka" [3]=> string(7) "Bojanja" } array(4) { [0]=> string(7) "Bojanja" [1]=> string(7) "Milanka" [2]=> string(5) "Červ" [3]=> string(6) "Žunko" } Fatal error: Call to undefined function collator_create() in /in/c1VuR on line 10
Process exited with code 255.