From 684b87a026d2e63317fa81f224f3ed758bee816f Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Mon, 10 Oct 2022 10:12:34 -0400 Subject: [PATCH] Deprecate SplFixedArray::__wakeup() GH-9354 added the `__serialize` and `__unserialize` method, so unserialize() and other unserializers will call `__unserialize` instead of `__wakeup` for SplFixedArray and userland subclasses. This targets php 8.3 because we've already released betas and release candidates for php 8.2. --- ext/spl/spl_fixedarray.stub.php | 5 ++++- ext/spl/spl_fixedarray_arginfo.h | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ext/spl/spl_fixedarray.stub.php b/ext/spl/spl_fixedarray.stub.php index e4b8fdce065bf..8ca6497be085c 100644 --- a/ext/spl/spl_fixedarray.stub.php +++ b/ext/spl/spl_fixedarray.stub.php @@ -6,7 +6,10 @@ class SplFixedArray implements IteratorAggregate, ArrayAccess, Countable, JsonSe { public function __construct(int $size = 0) {} - /** @tentative-return-type */ + /** + * @tentative-return-type + * @deprecated + */ public function __wakeup(): void {} public function __serialize(): array {} diff --git a/ext/spl/spl_fixedarray_arginfo.h b/ext/spl/spl_fixedarray_arginfo.h index ece12b998b0c6..aa92494a8f7d9 100644 --- a/ext/spl/spl_fixedarray_arginfo.h +++ b/ext/spl/spl_fixedarray_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 35a9585a433b9e3d57263c07ccafd1b6edd2f10b */ + * Stub hash: 453f55b59c0b61f2c8a41b17694be74c3e0a6171 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFixedArray___construct, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, size, IS_LONG, 0, "0") @@ -72,7 +72,7 @@ ZEND_METHOD(SplFixedArray, jsonSerialize); static const zend_function_entry class_SplFixedArray_methods[] = { ZEND_ME(SplFixedArray, __construct, arginfo_class_SplFixedArray___construct, ZEND_ACC_PUBLIC) - ZEND_ME(SplFixedArray, __wakeup, arginfo_class_SplFixedArray___wakeup, ZEND_ACC_PUBLIC) + ZEND_ME(SplFixedArray, __wakeup, arginfo_class_SplFixedArray___wakeup, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) ZEND_ME(SplFixedArray, __serialize, arginfo_class_SplFixedArray___serialize, ZEND_ACC_PUBLIC) ZEND_ME(SplFixedArray, __unserialize, arginfo_class_SplFixedArray___unserialize, ZEND_ACC_PUBLIC) ZEND_ME(SplFixedArray, count, arginfo_class_SplFixedArray_count, ZEND_ACC_PUBLIC)