<?php
$packed = array();
for ($i = 0; $i < 40; $i++) {
$packed[] = 'the number: ' . $i;
}
$ksort_string = $packed;
ksort($ksort_string, SORT_STRING);
var_dump($ksort_string);
- Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
- array(40) {
[0]=>
string(13) "the number: 0"
[1]=>
string(13) "the number: 1"
[10]=>
string(14) "the number: 10"
[11]=>
string(14) "the number: 11"
[12]=>
string(14) "the number: 12"
[13]=>
string(14) "the number: 13"
[14]=>
string(14) "the number: 14"
[15]=>
string(14) "the number: 15"
[16]=>
string(14) "the number: 16"
[17]=>
string(14) "the number: 17"
[18]=>
string(14) "the number: 18"
[19]=>
string(14) "the number: 19"
[2]=>
string(13) "the number: 2"
[20]=>
string(14) "the number: 20"
[21]=>
string(14) "the number: 21"
[22]=>
string(14) "the number: 22"
[23]=>
string(14) "the number: 23"
[24]=>
string(14) "the number: 24"
[25]=>
string(14) "the number: 25"
[26]=>
string(14) "the number: 26"
[27]=>
string(14) "the number: 27"
[28]=>
string(14) "the number: 28"
[29]=>
string(14) "the number: 29"
[3]=>
string(13) "the number: 3"
[30]=>
string(14) "the number: 30"
[31]=>
string(14) "the number: 31"
[32]=>
string(14) "the number: 32"
[33]=>
string(14) "the number: 33"
[34]=>
string(14) "the number: 34"
[35]=>
string(14) "the number: 35"
[36]=>
string(14) "the number: 36"
[37]=>
string(14) "the number: 37"
[38]=>
string(14) "the number: 38"
[39]=>
string(14) "the number: 39"
[4]=>
string(13) "the number: 4"
[5]=>
string(13) "the number: 5"
[6]=>
string(13) "the number: 6"
[7]=>
string(13) "the number: 7"
[8]=>
string(13) "the number: 8"
[9]=>
string(13) "the number: 9"
}
preferences:
239.72 ms | 409 KiB | 327 Q