Skip to content

Commit 23fc6d4

Browse files
committed
Add the test case for GH-9296
1 parent aa125c8 commit 23fc6d4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

ext/standard/tests/array/gh9296.phpt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
GH-9296: incorrect ksort(..., SORT_REGULAR) behaviour on arrays with numeric and string keys
3+
--FILE--
4+
<?php
5+
$array = ["aaa" => 0, 600 => 1];
6+
ksort($array, SORT_REGULAR);
7+
var_dump($array);
8+
var_dump(array_key_first($array) <=> array_key_last($array));
9+
?>
10+
--EXPECT--
11+
array(2) {
12+
[600]=>
13+
int(1)
14+
["aaa"]=>
15+
int(0)
16+
}
17+
int(-1)

0 commit comments

Comments
 (0)