3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a=['W10','W8','W9','W11','W6','W7']; $b=['W0010','W008','W009','W0011','W006','W007']; sort($a,SORT_NATURAL); sort($b,SORT_NATURAL); print_r($a); # Sort OK print_r($b); # Sort Wrong - Why? Bug?
based on XB1uq
Output for 5.4.0 - 7.1.0
Array ( [0] => W6 [1] => W7 [2] => W8 [3] => W9 [4] => W10 [5] => W11 ) Array ( [0] => W0010 [1] => W0011 [2] => W006 [3] => W007 [4] => W008 [5] => W009 )
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/POn0k on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/POn0k on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/POn0k on line 3
Process exited with code 255.