Skip to content

Commit

Permalink
Fix ArrayObject::exchangeArray() return type
Browse files Browse the repository at this point in the history
This method cannot return null.
  • Loading branch information
nikic committed Jul 6, 2021
1 parent 8071bd2 commit bcefc31
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ext/spl/spl_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ PHP_METHOD(ArrayObject, exchangeArray)

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

RETVAL_ARR(zend_array_dup(spl_array_get_hash_table(intern)));
Expand Down
2 changes: 1 addition & 1 deletion ext/spl/spl_array.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function __unserialize(array $data) {}
/** @return Iterator */
public function getIterator() {}

/** @return array|null */
/** @return array */
public function exchangeArray(array|object $array) {}

/** @return void */
Expand Down
2 changes: 1 addition & 1 deletion ext/spl/spl_array_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: da85db1e5e985ddbefaf38598133e3cba46475f2 */
* Stub hash: a4bc5ec5a95aae6bfa53988316cfa396f4f9fb92 */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject___construct, 0, 0, 0)
ZEND_ARG_TYPE_MASK(0, array, MAY_BE_ARRAY|MAY_BE_OBJECT, "[]")
Expand Down

0 comments on commit bcefc31

Please sign in to comment.