Skip to content

Commit bcefc31

Browse files
committed
Fix ArrayObject::exchangeArray() return type
This method cannot return null.
1 parent 8071bd2 commit bcefc31

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

ext/spl/spl_array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,7 @@ PHP_METHOD(ArrayObject, exchangeArray)
12921292

12931293
if (intern->nApplyCount > 0) {
12941294
zend_throw_error(NULL, "Modification of ArrayObject during sorting is prohibited");
1295-
return;
1295+
RETURN_THROWS();
12961296
}
12971297

12981298
RETVAL_ARR(zend_array_dup(spl_array_get_hash_table(intern)));

ext/spl/spl_array.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function __unserialize(array $data) {}
7878
/** @return Iterator */
7979
public function getIterator() {}
8080

81-
/** @return array|null */
81+
/** @return array */
8282
public function exchangeArray(array|object $array) {}
8383

8484
/** @return void */

ext/spl/spl_array_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: da85db1e5e985ddbefaf38598133e3cba46475f2 */
2+
* Stub hash: a4bc5ec5a95aae6bfa53988316cfa396f4f9fb92 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject___construct, 0, 0, 0)
55
ZEND_ARG_TYPE_MASK(0, array, MAY_BE_ARRAY|MAY_BE_OBJECT, "[]")

0 commit comments

Comments
 (0)