3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array( 'asd', 'ASD', 'sdf', 'SDF', 'Third', ); $b = array( '2 a', '1 b', '20 c', '10 d', '3 e', ); setlocale(LC_CTYPE, 'fi_FI'); array_multisort($b, SORT_STRING | SORT_FLAG_CASE, $a); var_dump($a, $b);
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(5) { [0]=> string(3) "ASD" [1]=> string(3) "SDF" [2]=> string(3) "asd" [3]=> string(3) "sdf" [4]=> string(5) "Third" } array(5) { [0]=> string(3) "1 b" [1]=> string(4) "10 d" [2]=> string(3) "2 a" [3]=> string(4) "20 c" [4]=> string(3) "3 e" }
Output for 4.3.0 - 5.3.29
Notice: Use of undefined constant SORT_FLAG_CASE - assumed 'SORT_FLAG_CASE' in /in/JWh21 on line 19 array(5) { [0]=> string(3) "ASD" [1]=> string(3) "SDF" [2]=> string(3) "asd" [3]=> string(3) "sdf" [4]=> string(5) "Third" } array(5) { [0]=> string(3) "1 b" [1]=> string(4) "10 d" [2]=> string(3) "2 a" [3]=> string(4) "20 c" [4]=> string(3) "3 e" }