3v4l.org

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