From 1daa222fbe83257bff129787d8a5a5d7463b5c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 4 May 2026 17:13:36 +0200 Subject: [PATCH 1/2] zend_types: Remove deprecated `Z_COPYABLE()` --- UPGRADING.INTERNALS | 2 ++ Zend/zend_types.h | 8 -------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index c0815a781d78..70cdcaacc8ea 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -98,6 +98,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES the non-throw versions. . The XtOffsetOf() alias of C’s offsetof() macro has been removed. Use offsetof() directly. + . The deprecated Z_COPYABLE(), Z_COPYABLE_P(), Z_OPT_COPYABLE(), and + Z_OPT_COPYABLE_P() macros have been removed. Check for IS_ARRAY directly. ======================== 2. Build system changes diff --git a/Zend/zend_types.h b/Zend/zend_types.h index 30d77da67323..ba579303e537 100644 --- a/Zend/zend_types.h +++ b/Zend/zend_types.h @@ -944,10 +944,6 @@ static zend_always_inline uint32_t zval_gc_info(uint32_t gc_type_info) { #define Z_COLLECTABLE(zval) ((Z_TYPE_FLAGS(zval) & IS_TYPE_COLLECTABLE) != 0) #define Z_COLLECTABLE_P(zval_p) Z_COLLECTABLE(*(zval_p)) -/* deprecated: (COPYABLE is the same as IS_ARRAY) */ -#define Z_COPYABLE(zval) (Z_TYPE(zval) == IS_ARRAY) -#define Z_COPYABLE_P(zval_p) Z_COPYABLE(*(zval_p)) - /* deprecated: (IMMUTABLE is the same as IS_ARRAY && !REFCOUNTED) */ #define Z_IMMUTABLE(zval) (Z_TYPE_INFO(zval) == IS_ARRAY) #define Z_IMMUTABLE_P(zval_p) Z_IMMUTABLE(*(zval_p)) @@ -967,10 +963,6 @@ static zend_always_inline uint32_t zval_gc_info(uint32_t gc_type_info) { #define Z_OPT_COLLECTABLE(zval) ((Z_TYPE_INFO(zval) & (IS_TYPE_COLLECTABLE << Z_TYPE_FLAGS_SHIFT)) != 0) #define Z_OPT_COLLECTABLE_P(zval_p) Z_OPT_COLLECTABLE(*(zval_p)) -/* deprecated: (COPYABLE is the same as IS_ARRAY) */ -#define Z_OPT_COPYABLE(zval) (Z_OPT_TYPE(zval) == IS_ARRAY) -#define Z_OPT_COPYABLE_P(zval_p) Z_OPT_COPYABLE(*(zval_p)) - #define Z_OPT_ISREF(zval) (Z_OPT_TYPE(zval) == IS_REFERENCE) #define Z_OPT_ISREF_P(zval_p) Z_OPT_ISREF(*(zval_p)) From e24bf3440c7f6bf4fb3771f4eb8230bd2e258ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 4 May 2026 17:15:04 +0200 Subject: [PATCH 2/2] zend_types: Remove deprecated `Z_OPT_IMMUTABLE()` and `Z_IMMUTABLE()` --- UPGRADING.INTERNALS | 3 +++ Zend/zend_types.h | 6 ------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 70cdcaacc8ea..a4297eec5870 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -100,6 +100,9 @@ PHP 8.6 INTERNALS UPGRADE NOTES offsetof() directly. . The deprecated Z_COPYABLE(), Z_COPYABLE_P(), Z_OPT_COPYABLE(), and Z_OPT_COPYABLE_P() macros have been removed. Check for IS_ARRAY directly. + . The deprecated Z_IMMUTABLE(), Z_IMMUTABLE_P(), Z_OPT_IMMUTABLE(), and + Z_OPT_IMMUTABLE_P() macros have been removed. Check for + IS_ARRAY && !REFCOUNTED directly. ======================== 2. Build system changes diff --git a/Zend/zend_types.h b/Zend/zend_types.h index ba579303e537..cfff3b942c4b 100644 --- a/Zend/zend_types.h +++ b/Zend/zend_types.h @@ -944,12 +944,6 @@ static zend_always_inline uint32_t zval_gc_info(uint32_t gc_type_info) { #define Z_COLLECTABLE(zval) ((Z_TYPE_FLAGS(zval) & IS_TYPE_COLLECTABLE) != 0) #define Z_COLLECTABLE_P(zval_p) Z_COLLECTABLE(*(zval_p)) -/* deprecated: (IMMUTABLE is the same as IS_ARRAY && !REFCOUNTED) */ -#define Z_IMMUTABLE(zval) (Z_TYPE_INFO(zval) == IS_ARRAY) -#define Z_IMMUTABLE_P(zval_p) Z_IMMUTABLE(*(zval_p)) -#define Z_OPT_IMMUTABLE(zval) Z_IMMUTABLE(zval_p) -#define Z_OPT_IMMUTABLE_P(zval_p) Z_IMMUTABLE(*(zval_p)) - /* the following Z_OPT_* macros make better code when Z_TYPE_INFO accessed before */ #define Z_OPT_TYPE(zval) (Z_TYPE_INFO(zval) & Z_TYPE_MASK) #define Z_OPT_TYPE_P(zval_p) Z_OPT_TYPE(*(zval_p))