diff --git a/UPGRADING b/UPGRADING index a9e6df8919bef..dc4240907b5c6 100644 --- a/UPGRADING +++ b/UPGRADING @@ -301,6 +301,12 @@ PDO_SQLITE: - PGSQL: . pg_select, the conditions arguments accepts an empty array and is optional. +- SPL: + . SplPriorityQueue::insert() and SplPriorityQueue::recoverFromCorruption() + now has a tentative return type of true + . SplHeap::insert() and SplHeap::recoverFromCorruption() + now has a tentative return type of true instead of bool + - Standard: . The internal implementation for rounding to integers has been rewritten to be easier to verify for correctness and to be easier to maintain. diff --git a/ext/spl/spl_heap.stub.php b/ext/spl/spl_heap.stub.php index 9a6ae7bf78fb8..c545d27dfc0f9 100644 --- a/ext/spl/spl_heap.stub.php +++ b/ext/spl/spl_heap.stub.php @@ -14,8 +14,8 @@ class SplPriorityQueue implements Iterator, Countable /** @tentative-return-type */ public function compare(mixed $priority1, mixed $priority2): int {} - /** @return true */ - public function insert(mixed $value, mixed $priority) {} // TODO make return type void + /** @tentative-return-type */ + public function insert(mixed $value, mixed $priority): true {} /** @tentative-return-type */ public function setExtractFlags(int $flags): int {} @@ -66,10 +66,10 @@ public function next(): void {} public function valid(): bool {} /** - * @return bool + * @tentative-return-type * @implementation-alias SplHeap::recoverFromCorruption */ - public function recoverFromCorruption() {} // TODO make return type void + public function recoverFromCorruption(): true {} /** * @tentative-return-type @@ -90,7 +90,7 @@ abstract class SplHeap implements Iterator, Countable public function extract(): mixed {} /** @tentative-return-type */ - public function insert(mixed $value): bool {} + public function insert(mixed $value): true {} /** @tentative-return-type */ public function top(): mixed {} @@ -117,7 +117,7 @@ public function next(): void {} public function valid(): bool {} /** @tentative-return-type */ - public function recoverFromCorruption(): bool {} + public function recoverFromCorruption(): true {} /** @tentative-return-type */ abstract protected function compare(mixed $value1, mixed $value2): int; diff --git a/ext/spl/spl_heap_arginfo.h b/ext/spl/spl_heap_arginfo.h index 3f1557f704db8..e5b1586c169b5 100644 --- a/ext/spl/spl_heap_arginfo.h +++ b/ext/spl/spl_heap_arginfo.h @@ -1,12 +1,12 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 627bf1f09cfb444f90e0dba6d2b7341312d723cf */ + * Stub hash: 47273e114c9c7089bf708a2f18f2e9e522abceb6 */ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SplPriorityQueue_compare, 0, 2, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, priority1, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, priority2, IS_MIXED, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplPriorityQueue_insert, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SplPriorityQueue_insert, 0, 2, IS_TRUE, 0) ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, priority, IS_MIXED, 0) ZEND_END_ARG_INFO() @@ -37,7 +37,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_SplPriorityQueue_valid arginfo_class_SplPriorityQueue_isEmpty -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplPriorityQueue_recoverFromCorruption, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SplPriorityQueue_recoverFromCorruption, 0, 0, IS_TRUE, 0) ZEND_END_ARG_INFO() #define arginfo_class_SplPriorityQueue_isCorrupted arginfo_class_SplPriorityQueue_isEmpty @@ -49,7 +49,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_SplHeap_extract arginfo_class_SplPriorityQueue_top -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SplHeap_insert, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SplHeap_insert, 0, 1, IS_TRUE, 0) ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_END_ARG_INFO() @@ -69,7 +69,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_SplHeap_valid arginfo_class_SplPriorityQueue_isEmpty -#define arginfo_class_SplHeap_recoverFromCorruption arginfo_class_SplPriorityQueue_isEmpty +#define arginfo_class_SplHeap_recoverFromCorruption arginfo_class_SplPriorityQueue_recoverFromCorruption ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SplHeap_compare, 0, 2, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, value1, IS_MIXED, 0)