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.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 hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0, 5.3.28 - 5.3.29
Notice: Use of undefined constant SORT_FLAG_CASE - assumed 'SORT_FLAG_CASE' in /in/bT53h on line 3 1: b = A banana 1: c = B apple 1: d = a lemon 1: a = a orange ===2: b = A banana 2: d = a lemon 2: a = a orange 2: c = B apple
Output for 4.3.1 - 5.3.27
Notice: Use of undefined constant SORT_FLAG_CASE - assumed 'SORT_FLAG_CASE' in /in/LiLYI on line 3 1: b = A banana 1: c = B apple 1: d = a lemon 1: a = a orange ===2: b = A banana 2: d = a lemon 2: a = a orange 2: c = B apple