1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix ArrayObject::exchangeArray() return type

This method cannot return null.
This commit is contained in:
Nikita Popov
2021-07-06 10:52:08 +02:00
parent 8071bd2faf
commit bcefc31e4e
3 changed files with 3 additions and 3 deletions

View File

@@ -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)));

View File

@@ -78,7 +78,7 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Count
/** @return Iterator */
public function getIterator() {}
/** @return array|null */
/** @return array */
public function exchangeArray(array|object $array) {}
/** @return void */

View File

@@ -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, "[]")