@@ -430,6 +430,32 @@ static phongo_create_object_retval php_phongo_timestamp_create_object(zend_class
430
430
#endif
431
431
} /* }}} */
432
432
433
+ static phongo_create_object_retval php_phongo_timestamp_clone_object (zval * object TSRMLS_DC ) /* {{{ */
434
+ {
435
+ php_phongo_timestamp_t * intern ;
436
+ php_phongo_timestamp_t * new_intern ;
437
+ phongo_create_object_retval new_object ;
438
+
439
+ intern = Z_TIMESTAMP_OBJ_P (object );
440
+ new_object = php_phongo_timestamp_create_object (Z_OBJCE_P (object ) TSRMLS_CC );
441
+
442
+ #if PHP_VERSION_ID >= 70000
443
+ new_intern = Z_OBJ_TIMESTAMP (new_object );
444
+ zend_objects_clone_members (& new_intern -> std , & intern -> std TSRMLS_CC );
445
+ #else
446
+ {
447
+ zend_object_handle handle = Z_OBJ_HANDLE_P (object );
448
+
449
+ new_intern = (php_phongo_timestamp_t * ) zend_object_store_get_object_by_handle (new_object .handle TSRMLS_CC );
450
+ zend_objects_clone_members (& new_intern -> std , new_object , & intern -> std , handle TSRMLS_CC );
451
+ }
452
+ #endif
453
+
454
+ php_phongo_timestamp_init (new_intern , intern -> increment , intern -> timestamp TSRMLS_CC );
455
+
456
+ return new_object ;
457
+ } /* }}} */
458
+
433
459
static int php_phongo_timestamp_compare_objects (zval * o1 , zval * o2 TSRMLS_DC ) /* {{{ */
434
460
{
435
461
php_phongo_timestamp_t * intern1 , * intern2 ;
@@ -531,6 +557,7 @@ void php_phongo_timestamp_init_ce(INIT_FUNC_ARGS) /* {{{ */
531
557
zend_class_implements (php_phongo_timestamp_ce TSRMLS_CC , 1 , zend_ce_serializable );
532
558
533
559
memcpy (& php_phongo_handler_timestamp , phongo_get_std_object_handlers (), sizeof (zend_object_handlers ));
560
+ php_phongo_handler_timestamp .clone_obj = php_phongo_timestamp_clone_object ;
534
561
php_phongo_handler_timestamp .compare_objects = php_phongo_timestamp_compare_objects ;
535
562
php_phongo_handler_timestamp .get_debug_info = php_phongo_timestamp_get_debug_info ;
536
563
php_phongo_handler_timestamp .get_gc = php_phongo_timestamp_get_gc ;
0 commit comments