Skip to content

Commit de90598

Browse files
authored
zend_types: Remove deprecated Z_*() macros (#21946)
* zend_types: Remove deprecated `Z_COPYABLE()` * zend_types: Remove deprecated `Z_OPT_IMMUTABLE()` and `Z_IMMUTABLE()`
1 parent c94cb02 commit de90598

2 files changed

Lines changed: 5 additions & 14 deletions

File tree

UPGRADING.INTERNALS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ PHP 8.6 INTERNALS UPGRADE NOTES
9898
the non-throw versions.
9999
. The XtOffsetOf() alias of C’s offsetof() macro has been removed. Use
100100
offsetof() directly.
101+
. The deprecated Z_COPYABLE(), Z_COPYABLE_P(), Z_OPT_COPYABLE(), and
102+
Z_OPT_COPYABLE_P() macros have been removed. Check for IS_ARRAY directly.
103+
. The deprecated Z_IMMUTABLE(), Z_IMMUTABLE_P(), Z_OPT_IMMUTABLE(), and
104+
Z_OPT_IMMUTABLE_P() macros have been removed. Check for
105+
IS_ARRAY && !REFCOUNTED directly.
101106

102107
========================
103108
2. Build system changes

Zend/zend_types.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -944,16 +944,6 @@ static zend_always_inline uint32_t zval_gc_info(uint32_t gc_type_info) {
944944
#define Z_COLLECTABLE(zval) ((Z_TYPE_FLAGS(zval) & IS_TYPE_COLLECTABLE) != 0)
945945
#define Z_COLLECTABLE_P(zval_p) Z_COLLECTABLE(*(zval_p))
946946

947-
/* deprecated: (COPYABLE is the same as IS_ARRAY) */
948-
#define Z_COPYABLE(zval) (Z_TYPE(zval) == IS_ARRAY)
949-
#define Z_COPYABLE_P(zval_p) Z_COPYABLE(*(zval_p))
950-
951-
/* deprecated: (IMMUTABLE is the same as IS_ARRAY && !REFCOUNTED) */
952-
#define Z_IMMUTABLE(zval) (Z_TYPE_INFO(zval) == IS_ARRAY)
953-
#define Z_IMMUTABLE_P(zval_p) Z_IMMUTABLE(*(zval_p))
954-
#define Z_OPT_IMMUTABLE(zval) Z_IMMUTABLE(zval_p)
955-
#define Z_OPT_IMMUTABLE_P(zval_p) Z_IMMUTABLE(*(zval_p))
956-
957947
/* the following Z_OPT_* macros make better code when Z_TYPE_INFO accessed before */
958948
#define Z_OPT_TYPE(zval) (Z_TYPE_INFO(zval) & Z_TYPE_MASK)
959949
#define Z_OPT_TYPE_P(zval_p) Z_OPT_TYPE(*(zval_p))
@@ -967,10 +957,6 @@ static zend_always_inline uint32_t zval_gc_info(uint32_t gc_type_info) {
967957
#define Z_OPT_COLLECTABLE(zval) ((Z_TYPE_INFO(zval) & (IS_TYPE_COLLECTABLE << Z_TYPE_FLAGS_SHIFT)) != 0)
968958
#define Z_OPT_COLLECTABLE_P(zval_p) Z_OPT_COLLECTABLE(*(zval_p))
969959

970-
/* deprecated: (COPYABLE is the same as IS_ARRAY) */
971-
#define Z_OPT_COPYABLE(zval) (Z_OPT_TYPE(zval) == IS_ARRAY)
972-
#define Z_OPT_COPYABLE_P(zval_p) Z_OPT_COPYABLE(*(zval_p))
973-
974960
#define Z_OPT_ISREF(zval) (Z_OPT_TYPE(zval) == IS_REFERENCE)
975961
#define Z_OPT_ISREF_P(zval_p) Z_OPT_ISREF(*(zval_p))
976962

0 commit comments

Comments
 (0)