3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php defined('SORT_FLAG_CASE') or define('SORT_FLAG_CASE', 8); echo 'SORT_FLAG_CASE : '.SORT_FLAG_CASE; $arr = array('foo' => 2,'Bar' => 1, 'bar' => 3, 'a' => 0); ksort($arr, SORT_STRING|SORT_FLAG_CASE); var_dump($arr);
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
SORT_FLAG_CASE : 8array(4) { ["a"]=> int(0) ["bar"]=> int(3) ["Bar"]=> int(1) ["foo"]=> int(2) }
Output for hhvm-3.10.0 - 3.12.0
SORT_FLAG_CASE : 8array(4) { ["a"]=> int(0) ["Bar"]=> int(1) ["bar"]=> int(3) ["foo"]=> int(2) }
Output for 4.3.0 - 5.3.29
SORT_FLAG_CASE : 8array(4) { ["Bar"]=> int(1) ["a"]=> int(0) ["bar"]=> int(3) ["foo"]=> int(2) }