@@ -104,6 +104,11 @@ static void prepare_class_constants(const pmmpthread_ident_t* source, zend_class
104
104
if (zc -> attributes ) {
105
105
rc -> attributes = pmmpthread_copy_attributes (source , zc -> attributes , zc -> ce -> type == ZEND_INTERNAL_CLASS ? NULL : zc -> ce -> info .user .filename );
106
106
}
107
+
108
+ #if PHP_VERSION_ID >= 80300
109
+ pmmpthread_copy_zend_type (& zc -> type , & rc -> type );
110
+ #endif
111
+
107
112
} ZEND_HASH_FOREACH_END ();
108
113
} /* }}} */
109
114
@@ -205,27 +210,7 @@ static void prepare_class_property_table(const pmmpthread_ident_t* source, zend_
205
210
} else dup -> ce = pmmpthread_prepared_entry (source , info -> ce );
206
211
}
207
212
208
- memcpy (& dup -> type , & info -> type , sizeof (zend_type ));
209
-
210
- //This code is based on zend_persist_type() in ext/opcache/zend_persist.c
211
- if (ZEND_TYPE_HAS_LIST (info -> type )) {
212
- const zend_type_list * old_list = ZEND_TYPE_LIST (info -> type );
213
- zend_type_list * new_list ;
214
- if (ZEND_TYPE_USES_ARENA (info -> type )) {
215
- new_list = zend_arena_alloc (& CG (arena ), ZEND_TYPE_LIST_SIZE (old_list -> num_types ));
216
- } else {
217
- new_list = emalloc (ZEND_TYPE_LIST_SIZE (old_list -> num_types ));
218
- }
219
- memcpy (new_list , old_list , ZEND_TYPE_LIST_SIZE (old_list -> num_types ));
220
- ZEND_TYPE_SET_PTR (dup -> type , new_list );
221
- }
222
-
223
- zend_type * single_type ;
224
- ZEND_TYPE_FOREACH (dup -> type , single_type ) {
225
- if (ZEND_TYPE_HAS_NAME (* single_type )) {
226
- ZEND_TYPE_SET_PTR (* single_type , pmmpthread_copy_string (ZEND_TYPE_NAME (* single_type )));
227
- }
228
- } ZEND_TYPE_FOREACH_END ();
213
+ pmmpthread_copy_zend_type (& info -> type , & dup -> type );
229
214
230
215
if (info -> attributes ) {
231
216
dup -> attributes = pmmpthread_copy_attributes (source , info -> attributes , info -> ce -> type == ZEND_INTERNAL_CLASS ? NULL : info -> ce -> info .user .filename );
0 commit comments