We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3663f76 commit 43d9f71Copy full SHA for 43d9f71
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