File tree 1 file changed +15
-3
lines changed 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -770,29 +770,41 @@ static inline void pmmpthread_prepare_constants(const pmmpthread_ident_t* source
770
770
zend_string * name ;
771
771
772
772
ZEND_HASH_FOREACH_STR_KEY_PTR (PMMPTHREAD_EG (source -> ls , zend_constants ), name , zconstant ) {
773
+ #if PHP_VERSION_ID < 80300
773
774
if (zconstant -> name ) {
775
+ #endif
774
776
if (Z_TYPE (zconstant -> value ) == IS_RESOURCE ){
775
777
//we can't copy these
776
778
continue ;
777
779
} else {
778
780
zend_constant constant ;
779
781
780
782
if (!pmmpthread_constant_exists (name )) {
781
- constant .name = pmmpthread_copy_string (name );
783
+ zend_string * name_copy = pmmpthread_copy_string (name );
784
+ #if PHP_VERSION_ID < 80300
785
+ constant .name = name_copy ;
786
+ #endif
782
787
783
788
if (pmmpthread_copy_zval (source , & constant .value , & zconstant -> value ) != SUCCESS ) {
784
789
zend_error_noreturn (
785
790
E_CORE_ERROR ,
786
791
"pmmpthread encountered an unknown non-copyable constant %s of type %s" ,
787
- ZSTR_VAL (zconstant -> name ),
792
+ ZSTR_VAL (name_copy ),
788
793
zend_zval_type_name (& zconstant -> value )
789
794
);
790
795
}
791
796
ZEND_CONSTANT_SET_FLAGS (& constant , ZEND_CONSTANT_FLAGS (zconstant ), ZEND_CONSTANT_MODULE_NUMBER (zconstant ));
792
- zend_register_constant (& constant );
797
+ zend_register_constant (
798
+ #if PHP_VERSION_ID >= 80300
799
+ name_copy ,
800
+ #endif
801
+ & constant
802
+ );
793
803
}
794
804
}
805
+ #if PHP_VERSION_ID < 80300
795
806
}
807
+ #endif
796
808
} ZEND_HASH_FOREACH_END ();
797
809
} /* }}} */
798
810
You can’t perform that action at this time.
0 commit comments