3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a=['z','Z','ą', 'Ą', 'a', 'o','ó','Ó','ł','Ł','ź','A','Ż','ę','e','ć','ń','ś']; $coll = collator_create( 'pl_PL' ); var_export( $a ); collator_sort( $coll, $a ); var_export( $a );
based on dVuFB
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 => 'ę', 14 => 'e', 15 => 'ć', 16 => 'ń', 17 => 'ś', )array ( 0 => 'a', 1 => 'A', 2 => 'ą', 3 => 'Ą', 4 => 'ć', 5 => 'e', 6 => 'ę', 7 => 'ł', 8 => 'Ł', 9 => 'ń', 10 => 'o', 11 => 'ó', 12 => 'Ó', 13 => 'ś', 14 => 'z', 15 => 'Z', 16 => 'ź', 17 => 'Ż', )
Output for 7.0.5
Fatal error: Uncaught Error: Call to undefined function collator_create() in /in/iZ3l7:5 Stack trace: #0 {main} thrown in /in/iZ3l7 on line 5
Process exited with code 255.
Output for 5.5.29 - 5.5.30, 5.5.34, 5.6.13 - 5.6.15, 5.6.20
Fatal error: Call to undefined function collator_create() in /in/iZ3l7 on line 5
Process exited with code 255.
Output for 5.3.22 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/iZ3l7 on line 2
Process exited with code 255.