3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a=array('z','Z','ą', 'Ą', 'a', 'o','ó','Ó','ł','Ł','ź','A','Ż','l','ę','L','e','ć','ń','ś'); $a=array_map( function($a){return mb_strtolower($a, 'utf-8');}, $a); $coll = new Collator( 'pl_PL' ); var_export( $a ); $coll->sort( $a ); var_export( $a );
based on kbBVU
Output for 5.4.12 - 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 ( 0 => 'z', 1 => 'z', 2 => 'ą', 3 => 'ą', 4 => 'a', 5 => 'o', 6 => 'ó', 7 => 'ó', 8 => 'ł', 9 => 'ł', 10 => 'ź', 11 => 'a', 12 => 'ż', 13 => 'l', 14 => 'ę', 15 => 'l', 16 => 'e', 17 => 'ć', 18 => 'ń', 19 => 'ś', )array ( 0 => 'a', 1 => 'a', 2 => 'ą', 3 => 'ą', 4 => 'ć', 5 => 'e', 6 => 'ę', 7 => 'l', 8 => 'l', 9 => 'ł', 10 => 'ł', 11 => 'ń', 12 => 'o', 13 => 'ó', 14 => 'ó', 15 => 'ś', 16 => 'z', 17 => 'z', 18 => 'ź', 19 => 'ż', )
Output for 7.0.5
Fatal error: Uncaught Error: Class 'Collator' not found in /in/J7P24:5 Stack trace: #0 {main} thrown in /in/J7P24 on line 5
Process exited with code 255.
Output for 5.3.22 - 5.3.29, 5.5.29 - 5.5.30, 5.5.34, 5.6.13 - 5.6.15, 5.6.20
Fatal error: Class 'Collator' not found in /in/J7P24 on line 5
Process exited with code 255.