@@ -249,6 +249,32 @@ phongo_create_object_retval php_phongo_symbol_create_object(zend_class_entry* cl
249
249
#endif
250
250
} /* }}} */
251
251
252
+ static phongo_create_object_retval php_phongo_symbol_clone_object (zval * object TSRMLS_DC ) /* {{{ */
253
+ {
254
+ php_phongo_symbol_t * intern ;
255
+ php_phongo_symbol_t * new_intern ;
256
+ phongo_create_object_retval new_object ;
257
+
258
+ intern = Z_SYMBOL_OBJ_P (object );
259
+ new_object = php_phongo_symbol_create_object (Z_OBJCE_P (object ) TSRMLS_CC );
260
+
261
+ #if PHP_VERSION_ID >= 70000
262
+ new_intern = Z_OBJ_SYMBOL (new_object );
263
+ zend_objects_clone_members (& new_intern -> std , & intern -> std TSRMLS_CC );
264
+ #else
265
+ {
266
+ zend_object_handle handle = Z_OBJ_HANDLE_P (object );
267
+
268
+ new_intern = (php_phongo_symbol_t * ) zend_object_store_get_object_by_handle (new_object .handle TSRMLS_CC );
269
+ zend_objects_clone_members (& new_intern -> std , new_object , & intern -> std , handle TSRMLS_CC );
270
+ }
271
+ #endif
272
+
273
+ php_phongo_symbol_init (new_intern , intern -> symbol , intern -> symbol_len TSRMLS_CC );
274
+
275
+ return new_object ;
276
+ } /* }}} */
277
+
252
278
static int php_phongo_symbol_compare_objects (zval * o1 , zval * o2 TSRMLS_DC ) /* {{{ */
253
279
{
254
280
php_phongo_symbol_t * intern1 , * intern2 ;
@@ -326,6 +352,7 @@ void php_phongo_symbol_init_ce(INIT_FUNC_ARGS) /* {{{ */
326
352
zend_class_implements (php_phongo_symbol_ce TSRMLS_CC , 1 , zend_ce_serializable );
327
353
328
354
memcpy (& php_phongo_handler_symbol , phongo_get_std_object_handlers (), sizeof (zend_object_handlers ));
355
+ php_phongo_handler_symbol .clone_obj = php_phongo_symbol_clone_object ;
329
356
php_phongo_handler_symbol .compare_objects = php_phongo_symbol_compare_objects ;
330
357
php_phongo_handler_symbol .get_debug_info = php_phongo_symbol_get_debug_info ;
331
358
php_phongo_handler_symbol .get_gc = php_phongo_symbol_get_gc ;
0 commit comments