@@ -36,7 +36,7 @@ static inline int msgpack_convert_long_to_properties(HashTable *ht, zval *object
3636
3737 if (msgpack_convert_array (& tplval , data , dataval ) == SUCCESS ) {
3838 zend_hash_move_forward_ex (props , prop_pos );
39- zend_update_property (Z_OBJCE_P (object ), object , prop_name , prop_len , & tplval );
39+ zend_update_property (Z_OBJCE_P (object ), OBJ_FOR_PROP ( object ) , prop_name , prop_len , & tplval );
4040 return SUCCESS ;
4141 }
4242 return FAILURE ;
@@ -45,14 +45,14 @@ static inline int msgpack_convert_long_to_properties(HashTable *ht, zval *object
4545 {
4646 if (msgpack_convert_object (& tplval , data , val ) == SUCCESS ) {
4747 zend_hash_move_forward_ex (props , prop_pos );
48- zend_update_property (Z_OBJCE_P (object ), object , prop_name , prop_len , & tplval );
48+ zend_update_property (Z_OBJCE_P (object ), OBJ_FOR_PROP ( object ) , prop_name , prop_len , & tplval );
4949 return SUCCESS ;
5050 }
5151 return FAILURE ;
5252 }
5353 default :
5454 zend_hash_move_forward_ex (props , prop_pos );
55- zend_update_property (Z_OBJCE_P (object ), object , prop_name , prop_len , val );
55+ zend_update_property (Z_OBJCE_P (object ), OBJ_FOR_PROP ( object ) , prop_name , prop_len , val );
5656 return SUCCESS ;
5757 }
5858 }
@@ -64,7 +64,15 @@ static inline int msgpack_convert_long_to_properties(HashTable *ht, zval *object
6464 * properties = NULL ;
6565 }
6666 ZVAL_LONG (& key_zv , key_index );
67+ #if PHP_VERSION_ID < 80000
6768 zend_std_write_property (object , & key_zv , val , NULL );
69+ #else
70+ {
71+ zend_string * key = zval_get_string (& key_zv );
72+ zend_std_write_property (Z_OBJ_P (object ), key , val , NULL );
73+ zend_string_release (key );
74+ }
75+ #endif
6876 return SUCCESS ;
6977}
7078/* }}} */
@@ -81,13 +89,17 @@ static inline int msgpack_convert_string_to_properties(zval *object, zend_string
8189 prot_name = zend_mangle_property_name ("*" , 1 , ZSTR_VAL (key ), ZSTR_LEN (key ), 1 );
8290
8391 if (zend_hash_find (propers , priv_name ) != NULL ) {
84- zend_update_property_ex (ce , object , key , val );
92+ zend_update_property_ex (ce , OBJ_FOR_PROP ( object ) , key , val );
8593 return_code = SUCCESS ;
8694 } else if (zend_hash_find (propers , prot_name ) != NULL ) {
87- zend_update_property_ex (ce , object , key , val );
95+ zend_update_property_ex (ce , OBJ_FOR_PROP ( object ) , key , val );
8896 return_code = SUCCESS ;
8997 } else {
98+ #if PHP_VERSION_ID < 80000
9099 zend_std_write_property (object , & pub_name , val , NULL );
100+ #else
101+ zend_std_write_property (Z_OBJ_P (object ), key , val , NULL );
102+ #endif
91103 return_code = FAILURE ;
92104 }
93105 zend_hash_add (var , Z_STR (pub_name ), val );
@@ -298,8 +310,9 @@ int msgpack_convert_object(zval *return_value, zval *tpl, zval *value) /* {{{ */
298310 fci .retval = & retval ;
299311 fci .param_count = 0 ;
300312 fci .params = & params ;
313+ #if PHP_VERSION_ID < 80000
301314 fci .no_separation = 1 ;
302-
315+ #endif
303316#if PHP_VERSION_ID < 70300
304317 fcc .initialized = 1 ;
305318#endif
@@ -358,7 +371,11 @@ int msgpack_convert_object(zval *return_value, zval *tpl, zval *value) /* {{{ */
358371 } ZEND_HASH_FOREACH_END ();
359372
360373 /* index */
374+ #if PHP_VERSION_ID < 80000
361375 properties = Z_OBJ_HT_P (return_value )-> get_properties (return_value );
376+ #else
377+ properties = Z_OBJ_HT_P (return_value )-> get_properties (Z_OBJ_P (return_value ));
378+ #endif
362379 if (HASH_OF (tpl )) {
363380 properties = HASH_OF (tpl );
364381 }
@@ -418,10 +435,10 @@ int msgpack_convert_object(zval *return_value, zval *tpl, zval *value) /* {{{ */
418435 return FAILURE ;
419436 }
420437
421- zend_update_property_ex (ce , return_value , str_key , & nv );
438+ zend_update_property_ex (ce , OBJ_FOR_PROP ( return_value ) , str_key , & nv );
422439 zval_ptr_dtor (& nv );
423440 } else {
424- zend_update_property (ce , return_value , prop_name , prop_len , aryval );
441+ zend_update_property (ce , OBJ_FOR_PROP ( return_value ) , prop_name , prop_len , aryval );
425442 }
426443 num_key ++ ;
427444 } ZEND_HASH_FOREACH_END ();
@@ -433,7 +450,11 @@ int msgpack_convert_object(zval *return_value, zval *tpl, zval *value) /* {{{ */
433450 HashTable * properties = NULL ;
434451 HashPosition prop_pos ;
435452
453+ #if PHP_VERSION_ID < 80000
436454 properties = Z_OBJ_HT_P (return_value )-> get_properties (return_value );
455+ #else
456+ properties = Z_OBJ_HT_P (return_value )-> get_properties (Z_OBJ_P (return_value ));
457+ #endif
437458 zend_hash_internal_pointer_reset_ex (properties , & prop_pos );
438459
439460 if (msgpack_convert_long_to_properties (HASH_OF (return_value ), return_value , & properties , & prop_pos , 0 , value , NULL ) != SUCCESS ) {
0 commit comments