(Christian Wenz)
. Fixed bug #69889 (Null coalesce operator doesn't work for string offsets).
(Nikita)
+ . Fixed bug #69891 (Unexpected array comparison result). (Nikita)
. Fixed bug #69892 (Different arrays compare indentical due to integer key
truncation). (Nikita)
. Fixed bug #69893 (Strict comparison between integer and empty string keys
--- /dev/null
+--TEST--
+Bug #69891: Unexpected array comparison result
+--FILE--
+<?php
+
+var_dump([1, 2, 3] <=> []);
+var_dump([] <=> [1, 2, 3]);
+var_dump([1] <=> [2, 3]);
+--EXPECT--
+int(1)
+int(-1)
+int(-1)
--- /dev/null
+--TEST--
+Bug #69893: Strict comparison between integer and empty string keys crashes
+--FILE--
+<?php
+var_dump([0 => 0] === ["" => 0]);
+?>
+--EXPECT--
+bool(false)
HASH_PROTECT_RECURSION(ht1);
HASH_PROTECT_RECURSION(ht2);
- result = ht1->nNumOfElements - ht2->nNumOfElements;
- if (result!=0) {
+ if (ht1->nNumOfElements != ht2->nNumOfElements) {
HASH_UNPROTECT_RECURSION(ht1);
HASH_UNPROTECT_RECURSION(ht2);
- return result;
+ return ht1->nNumOfElements > ht2->nNumOfElements ? 1 : -1;
}
for (idx1 = 0, idx2 = 0; idx1 < ht1->nNumUsed; idx1++) {