@@ -57,9 +57,9 @@ zend_object *zend_enum_new(zval *result, zend_class_entry *ce, zend_string *case
5757 return zobj ;
5858}
5959
60- static void zend_verify_enum_properties (zend_class_entry * ce )
60+ static void zend_verify_enum_properties (const zend_class_entry * ce )
6161{
62- zend_property_info * property_info ;
62+ const zend_property_info * property_info ;
6363
6464 ZEND_HASH_MAP_FOREACH_PTR (& ce -> properties_info , property_info ) {
6565 if (zend_string_equals (property_info -> name , ZSTR_KNOWN (ZEND_STR_NAME ))) {
@@ -77,7 +77,7 @@ static void zend_verify_enum_properties(zend_class_entry *ce)
7777 } ZEND_HASH_FOREACH_END ();
7878}
7979
80- static void zend_verify_enum_magic_methods (zend_class_entry * ce )
80+ static void zend_verify_enum_magic_methods (const zend_class_entry * ce )
8181{
8282 // Only __get, __call and __invoke are allowed
8383
@@ -109,15 +109,15 @@ static void zend_verify_enum_magic_methods(zend_class_entry *ce)
109109 }
110110}
111111
112- static void zend_verify_enum_interfaces (zend_class_entry * ce )
112+ static void zend_verify_enum_interfaces (const zend_class_entry * ce )
113113{
114114 if (zend_class_implements_interface (ce , zend_ce_serializable )) {
115115 zend_error_noreturn (E_COMPILE_ERROR ,
116116 "Enum %s cannot implement the Serializable interface" , ZSTR_VAL (ce -> name ));
117117 }
118118}
119119
120- void zend_verify_enum (zend_class_entry * ce )
120+ void zend_verify_enum (const zend_class_entry * ce )
121121{
122122 zend_verify_enum_properties (ce );
123123 zend_verify_enum_magic_methods (ce );
@@ -205,7 +205,7 @@ zend_result zend_enum_build_backed_enum_table(zend_class_entry *ce)
205205 zend_hash_init (backed_enum_table , 0 , NULL , ZVAL_PTR_DTOR , 0 );
206206 zend_class_set_backed_enum_table (ce , backed_enum_table );
207207
208- zend_string * enum_class_name = ce -> name ;
208+ const zend_string * enum_class_name = ce -> name ;
209209
210210 zend_string * name ;
211211 zval * val ;
@@ -228,7 +228,7 @@ zend_result zend_enum_build_backed_enum_table(zend_class_entry *ce)
228228
229229 if (ce -> enum_backing_type == IS_LONG ) {
230230 zend_long long_key = Z_LVAL_P (case_value );
231- zval * existing_case_name = zend_hash_index_find (backed_enum_table , long_key );
231+ const zval * existing_case_name = zend_hash_index_find (backed_enum_table , long_key );
232232 if (existing_case_name ) {
233233 zend_throw_error (NULL , "Duplicate value in enum %s for cases %s and %s" ,
234234 ZSTR_VAL (enum_class_name ),
@@ -241,7 +241,7 @@ zend_result zend_enum_build_backed_enum_table(zend_class_entry *ce)
241241 } else {
242242 ZEND_ASSERT (ce -> enum_backing_type == IS_STRING );
243243 zend_string * string_key = Z_STR_P (case_value );
244- zval * existing_case_name = zend_hash_find (backed_enum_table , string_key );
244+ const zval * existing_case_name = zend_hash_find (backed_enum_table , string_key );
245245 if (existing_case_name != NULL ) {
246246 zend_throw_error (NULL , "Duplicate value in enum %s for cases %s and %s" ,
247247 ZSTR_VAL (enum_class_name ),
@@ -294,7 +294,7 @@ ZEND_API zend_result zend_enum_get_case_by_value(zend_object **result, zend_clas
294294 }
295295 }
296296
297- HashTable * backed_enum_table = CE_BACKED_ENUM_TABLE (ce );
297+ const HashTable * backed_enum_table = CE_BACKED_ENUM_TABLE (ce );
298298 if (!backed_enum_table ) {
299299 goto not_found ;
300300 }
0 commit comments