We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a6f489b commit ad04345Copy full SHA for ad04345
NEWS
@@ -20,6 +20,7 @@ PHP NEWS
20
21
- Standard:
22
. Fixed bug #65489 (glob() basedir check is inconsistent). (Jakub Zelenka)
23
+ . Fixed GH-9244 (Segfault with array_multisort + array_shift). (cmb)
24
25
04 Aug 2022, PHP 8.2.0beta2
26
ext/standard/array.c
@@ -5791,6 +5791,8 @@ PHP_FUNCTION(array_multisort)
5791
}
5792
if (repack) {
5793
zend_hash_to_packed(hash);
5794
+ } else {
5795
+ zend_hash_rehash(hash);
5796
5797
5798
ext/standard/tests/array/gh9244.phpt
@@ -0,0 +1,11 @@
1
+--TEST--
2
+Bug GH-9244 (Segfault with array_multisort + array_shift)
3
+--FILE--
4
+<?php
5
+$items = ['foo' => 1, 'bar' => 2];
6
+$order = [4, 3];
7
+array_multisort($order, $items);
8
+var_dump(array_shift($items));
9
+?>
10
+--EXPECT--
11
+int(2)
0 commit comments