3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $fruits = array("d" => "A lemon", "a" => "a orange", "b" => "A banana", "c" => "B apple"); asort($fruits, SORT_STRING | SORT_FLAG_CASE); foreach ($fruits as $key => $val) { echo "1: $key = $val\n"; } echo "==="; $fruits2 = array("d" => "A lemon", "a" => "a orange", "b" => "A banana", "c" => "B apple"); natcasesort($fruits2); foreach ($fruits2 as $key => $val) { echo "2: $key = $val\n"; } ?>
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
1: b = A banana 1: d = A lemon 1: a = a orange 1: c = B apple ===2: b = A banana 2: d = A lemon 2: a = a orange 2: c = B apple
Output for 4.3.0 - 5.3.29
Notice: Use of undefined constant SORT_FLAG_CASE - assumed 'SORT_FLAG_CASE' in /in/5ref9 on line 3 1: b = A banana 1: d = A lemon 1: c = B apple 1: a = a orange ===2: b = A banana 2: d = A lemon 2: a = a orange 2: c = B apple