@@ -223,7 +223,7 @@ static void zend_std_call_issetter(zend_object *zobj, zend_string *prop_name, zv
223
223
/* }}} */
224
224
225
225
226
- static zend_always_inline bool is_derived_class (zend_class_entry * child_class , zend_class_entry * parent_class ) /* {{{ */
226
+ static zend_always_inline bool is_derived_class (const zend_class_entry * child_class , const zend_class_entry * parent_class ) /* {{{ */
227
227
{
228
228
child_class = child_class -> parent ;
229
229
while (child_class ) {
@@ -237,14 +237,14 @@ static zend_always_inline bool is_derived_class(zend_class_entry *child_class, z
237
237
}
238
238
/* }}} */
239
239
240
- static zend_never_inline int is_protected_compatible_scope (zend_class_entry * ce , zend_class_entry * scope ) /* {{{ */
240
+ static zend_never_inline int is_protected_compatible_scope (const zend_class_entry * ce , const zend_class_entry * scope ) /* {{{ */
241
241
{
242
242
return scope &&
243
243
(is_derived_class (ce , scope ) || is_derived_class (scope , ce ));
244
244
}
245
245
/* }}} */
246
246
247
- static zend_never_inline zend_property_info * zend_get_parent_private_property (zend_class_entry * scope , zend_class_entry * ce , zend_string * member ) /* {{{ */
247
+ static zend_never_inline zend_property_info * zend_get_parent_private_property (zend_class_entry * scope , const zend_class_entry * ce , zend_string * member ) /* {{{ */
248
248
{
249
249
zval * zv ;
250
250
zend_property_info * prop_info ;
@@ -263,7 +263,7 @@ static zend_never_inline zend_property_info *zend_get_parent_private_property(ze
263
263
}
264
264
/* }}} */
265
265
266
- static ZEND_COLD zend_never_inline void zend_bad_property_access (zend_property_info * property_info , zend_class_entry * ce , zend_string * member ) /* {{{ */
266
+ static ZEND_COLD zend_never_inline void zend_bad_property_access (const zend_property_info * property_info , const zend_class_entry * ce , const zend_string * member ) /* {{{ */
267
267
{
268
268
zend_throw_error (NULL , "Cannot access %s property %s::$%s" , zend_visibility_string (property_info -> flags ), ZSTR_VAL (ce -> name ), ZSTR_VAL (member ));
269
269
}
@@ -276,13 +276,13 @@ static ZEND_COLD zend_never_inline void zend_bad_property_name(void) /* {{{ */
276
276
/* }}} */
277
277
278
278
static ZEND_COLD zend_never_inline void zend_forbidden_dynamic_property (
279
- zend_class_entry * ce , zend_string * member ) {
279
+ const zend_class_entry * ce , const zend_string * member ) {
280
280
zend_throw_error (NULL , "Cannot create dynamic property %s::$%s" ,
281
281
ZSTR_VAL (ce -> name ), ZSTR_VAL (member ));
282
282
}
283
283
284
284
static ZEND_COLD zend_never_inline bool zend_deprecated_dynamic_property (
285
- zend_object * obj , zend_string * member ) {
285
+ zend_object * obj , const zend_string * member ) {
286
286
GC_ADDREF (obj );
287
287
zend_error (E_DEPRECATED , "Creation of dynamic property %s::$%s is deprecated" ,
288
288
ZSTR_VAL (obj -> ce -> name ), ZSTR_VAL (member ));
@@ -300,7 +300,7 @@ static ZEND_COLD zend_never_inline bool zend_deprecated_dynamic_property(
300
300
}
301
301
302
302
static ZEND_COLD zend_never_inline void zend_readonly_property_modification_scope_error (
303
- zend_class_entry * ce , zend_string * member , zend_class_entry * scope , const char * operation ) {
303
+ const zend_class_entry * ce , const zend_string * member , const zend_class_entry * scope , const char * operation ) {
304
304
zend_throw_error (NULL , "Cannot %s readonly property %s::$%s from %s%s" ,
305
305
operation , ZSTR_VAL (ce -> name ), ZSTR_VAL (member ),
306
306
scope ? "scope " : "global scope" , scope ? ZSTR_VAL (scope -> name ) : "" );
@@ -312,7 +312,7 @@ static ZEND_COLD zend_never_inline void zend_readonly_property_unset_error(
312
312
ZSTR_VAL (ce -> name ), ZSTR_VAL (member ));
313
313
}
314
314
315
- static zend_always_inline uintptr_t zend_get_property_offset (zend_class_entry * ce , zend_string * member , int silent , void * * cache_slot , zend_property_info * * info_ptr ) /* {{{ */
315
+ static zend_always_inline uintptr_t zend_get_property_offset (zend_class_entry * ce , zend_string * member , int silent , void * * cache_slot , const zend_property_info * * info_ptr ) /* {{{ */
316
316
{
317
317
zval * zv ;
318
318
zend_property_info * property_info ;
@@ -411,14 +411,14 @@ static zend_always_inline uintptr_t zend_get_property_offset(zend_class_entry *c
411
411
412
412
static ZEND_COLD void zend_wrong_offset (zend_class_entry * ce , zend_string * member ) /* {{{ */
413
413
{
414
- zend_property_info * dummy ;
414
+ const zend_property_info * dummy ;
415
415
416
416
/* Trigger the correct error */
417
417
zend_get_property_offset (ce , member , 0 , NULL , & dummy );
418
418
}
419
419
/* }}} */
420
420
421
- ZEND_API zend_property_info * zend_get_property_info (zend_class_entry * ce , zend_string * member , int silent ) /* {{{ */
421
+ ZEND_API zend_property_info * zend_get_property_info (const zend_class_entry * ce , zend_string * member , int silent ) /* {{{ */
422
422
{
423
423
zval * zv ;
424
424
zend_property_info * property_info ;
@@ -594,7 +594,7 @@ ZEND_API zval *zend_std_read_property(zend_object *zobj, zend_string *name, int
594
594
{
595
595
zval * retval ;
596
596
uintptr_t property_offset ;
597
- zend_property_info * prop_info = NULL ;
597
+ const zend_property_info * prop_info = NULL ;
598
598
uint32_t * guard = NULL ;
599
599
zend_string * tmp_name = NULL ;
600
600
@@ -767,7 +767,7 @@ static zend_always_inline bool property_uses_strict_types(void) {
767
767
}
768
768
769
769
static bool verify_readonly_initialization_access (
770
- zend_property_info * prop_info , zend_class_entry * ce ,
770
+ const zend_property_info * prop_info , const zend_class_entry * ce ,
771
771
zend_string * name , const char * operation ) {
772
772
zend_class_entry * scope ;
773
773
if (UNEXPECTED (EG (fake_scope ))) {
@@ -782,7 +782,7 @@ static bool verify_readonly_initialization_access(
782
782
/* We may have redeclared a parent property. In that case the parent should still be
783
783
* allowed to initialize it. */
784
784
if (scope && is_derived_class (ce , scope )) {
785
- zend_property_info * prop_info = zend_hash_find_ptr (& scope -> properties_info , name );
785
+ const zend_property_info * prop_info = zend_hash_find_ptr (& scope -> properties_info , name );
786
786
if (prop_info ) {
787
787
/* This should be ensured by inheritance. */
788
788
ZEND_ASSERT (prop_info -> flags & ZEND_ACC_READONLY );
@@ -800,7 +800,7 @@ ZEND_API zval *zend_std_write_property(zend_object *zobj, zend_string *name, zva
800
800
{
801
801
zval * variable_ptr , tmp ;
802
802
uintptr_t property_offset ;
803
- zend_property_info * prop_info = NULL ;
803
+ const zend_property_info * prop_info = NULL ;
804
804
ZEND_ASSERT (!Z_ISREF_P (value ));
805
805
806
806
property_offset = zend_get_property_offset (zobj -> ce , name , (zobj -> ce -> __set != NULL ), cache_slot , & prop_info );
@@ -1037,7 +1037,7 @@ ZEND_API zval *zend_std_get_property_ptr_ptr(zend_object *zobj, zend_string *nam
1037
1037
{
1038
1038
zval * retval = NULL ;
1039
1039
uintptr_t property_offset ;
1040
- zend_property_info * prop_info = NULL ;
1040
+ const zend_property_info * prop_info = NULL ;
1041
1041
1042
1042
#if DEBUG_OBJECT_HANDLERS
1043
1043
fprintf (stderr , "Ptr object #%d property: %s\n" , zobj -> handle , ZSTR_VAL (name ));
@@ -1118,7 +1118,7 @@ ZEND_API zval *zend_std_get_property_ptr_ptr(zend_object *zobj, zend_string *nam
1118
1118
ZEND_API void zend_std_unset_property (zend_object * zobj , zend_string * name , void * * cache_slot ) /* {{{ */
1119
1119
{
1120
1120
uintptr_t property_offset ;
1121
- zend_property_info * prop_info = NULL ;
1121
+ const zend_property_info * prop_info = NULL ;
1122
1122
1123
1123
property_offset = zend_get_property_offset (zobj -> ce , name , (zobj -> ce -> __unset != NULL ), cache_slot , & prop_info );
1124
1124
@@ -1750,7 +1750,7 @@ ZEND_API int zend_std_has_property(zend_object *zobj, zend_string *name, int has
1750
1750
int result ;
1751
1751
zval * value = NULL ;
1752
1752
uintptr_t property_offset ;
1753
- zend_property_info * prop_info = NULL ;
1753
+ const zend_property_info * prop_info = NULL ;
1754
1754
zend_string * tmp_name = NULL ;
1755
1755
1756
1756
property_offset = zend_get_property_offset (zobj -> ce , name , 1 , cache_slot , & prop_info );
0 commit comments