Skip to content

Commit 1ee94f5

Browse files
committed
Removed IS_TYPE_COPYABLE flag from IS_STRING zvals.
1 parent 0a336f9 commit 1ee94f5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

UPGRADING.INTERNALS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ PHP 7.3 INTERNALS UPGRADE NOTES
1414
k. zend_fcall_info_cache.initialized
1515
l. php_hrtime_current()
1616
m. zend_cpu_supports()
17+
n. IS_TYPE_COPYABLE
1718

1819
2. Build system changes
1920
a. Unix build system changes
@@ -102,6 +103,11 @@ PHP 7.3 INTERNALS UPGRADE NOTES
102103

103104
m. zend_cpu_supports() determines if a feature is supported by current cpu.
104105

106+
n. IS_STRING zvals don't set IS_TYPE_COPYALE anymore. This prevents string
107+
duplication by zval_copy_ctor(), ZVAL_DUP() and SEPARATE_ZVAL*() macros.
108+
Interned strings didn't set IS_TYPE_COPYALE, so they aren't affected at
109+
all.
110+
105111
========================
106112
2. Build system changes
107113
========================

Zend/zend_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
476476
/* extended types */
477477
#define IS_INTERNED_STRING_EX IS_STRING
478478

479-
#define IS_STRING_EX (IS_STRING | ((IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE) << Z_TYPE_FLAGS_SHIFT))
479+
#define IS_STRING_EX (IS_STRING | ((IS_TYPE_REFCOUNTED ) << Z_TYPE_FLAGS_SHIFT))
480480
#define IS_ARRAY_EX (IS_ARRAY | ((IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE) << Z_TYPE_FLAGS_SHIFT))
481481
#define IS_OBJECT_EX (IS_OBJECT | ((IS_TYPE_REFCOUNTED ) << Z_TYPE_FLAGS_SHIFT))
482482
#define IS_RESOURCE_EX (IS_RESOURCE | ((IS_TYPE_REFCOUNTED ) << Z_TYPE_FLAGS_SHIFT))

0 commit comments

Comments
 (0)