@@ -224,7 +224,7 @@ static void zend_std_call_issetter(zend_object *zobj, zend_string *prop_name, zv
224
224
/* }}} */
225
225
226
226
227
- static zend_always_inline bool is_derived_class (zend_class_entry * child_class , zend_class_entry * parent_class ) /* {{{ */
227
+ static zend_always_inline bool is_derived_class (const zend_class_entry * child_class , const zend_class_entry * parent_class ) /* {{{ */
228
228
{
229
229
child_class = child_class -> parent ;
230
230
while (child_class ) {
@@ -238,14 +238,14 @@ static zend_always_inline bool is_derived_class(zend_class_entry *child_class, z
238
238
}
239
239
/* }}} */
240
240
241
- static zend_never_inline int is_protected_compatible_scope (zend_class_entry * ce , zend_class_entry * scope ) /* {{{ */
241
+ static zend_never_inline int is_protected_compatible_scope (const zend_class_entry * ce , const zend_class_entry * scope ) /* {{{ */
242
242
{
243
243
return scope &&
244
244
(is_derived_class (ce , scope ) || is_derived_class (scope , ce ));
245
245
}
246
246
/* }}} */
247
247
248
- static zend_never_inline zend_property_info * zend_get_parent_private_property (zend_class_entry * scope , zend_class_entry * ce , zend_string * member ) /* {{{ */
248
+ static zend_never_inline zend_property_info * zend_get_parent_private_property (zend_class_entry * scope , const zend_class_entry * ce , zend_string * member ) /* {{{ */
249
249
{
250
250
zval * zv ;
251
251
zend_property_info * prop_info ;
@@ -264,7 +264,7 @@ static zend_never_inline zend_property_info *zend_get_parent_private_property(ze
264
264
}
265
265
/* }}} */
266
266
267
- static ZEND_COLD zend_never_inline void zend_bad_property_access (zend_property_info * property_info , zend_class_entry * ce , zend_string * member ) /* {{{ */
267
+ 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 ) /* {{{ */
268
268
{
269
269
zend_throw_error (NULL , "Cannot access %s property %s::$%s" , zend_visibility_string (property_info -> flags ), ZSTR_VAL (ce -> name ), ZSTR_VAL (member ));
270
270
}
@@ -277,13 +277,13 @@ static ZEND_COLD zend_never_inline void zend_bad_property_name(void) /* {{{ */
277
277
/* }}} */
278
278
279
279
static ZEND_COLD zend_never_inline void zend_forbidden_dynamic_property (
280
- zend_class_entry * ce , zend_string * member ) {
280
+ const zend_class_entry * ce , const zend_string * member ) {
281
281
zend_throw_error (NULL , "Cannot create dynamic property %s::$%s" ,
282
282
ZSTR_VAL (ce -> name ), ZSTR_VAL (member ));
283
283
}
284
284
285
285
static ZEND_COLD zend_never_inline bool zend_deprecated_dynamic_property (
286
- zend_object * obj , zend_string * member ) {
286
+ zend_object * obj , const zend_string * member ) {
287
287
GC_ADDREF (obj );
288
288
zend_error (E_DEPRECATED , "Creation of dynamic property %s::$%s is deprecated" ,
289
289
ZSTR_VAL (obj -> ce -> name ), ZSTR_VAL (member ));
@@ -301,7 +301,7 @@ static ZEND_COLD zend_never_inline bool zend_deprecated_dynamic_property(
301
301
}
302
302
303
303
static ZEND_COLD zend_never_inline void zend_readonly_property_modification_scope_error (
304
- zend_class_entry * ce , zend_string * member , zend_class_entry * scope , const char * operation ) {
304
+ const zend_class_entry * ce , const zend_string * member , const zend_class_entry * scope , const char * operation ) {
305
305
zend_throw_error (NULL , "Cannot %s readonly property %s::$%s from %s%s" ,
306
306
operation , ZSTR_VAL (ce -> name ), ZSTR_VAL (member ),
307
307
scope ? "scope " : "global scope" , scope ? ZSTR_VAL (scope -> name ) : "" );
@@ -313,7 +313,7 @@ static ZEND_COLD zend_never_inline void zend_readonly_property_unset_error(
313
313
ZSTR_VAL (ce -> name ), ZSTR_VAL (member ));
314
314
}
315
315
316
- 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 ) /* {{{ */
316
+ 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 ) /* {{{ */
317
317
{
318
318
zval * zv ;
319
319
zend_property_info * property_info ;
@@ -412,14 +412,14 @@ static zend_always_inline uintptr_t zend_get_property_offset(zend_class_entry *c
412
412
413
413
static ZEND_COLD void zend_wrong_offset (zend_class_entry * ce , zend_string * member ) /* {{{ */
414
414
{
415
- zend_property_info * dummy ;
415
+ const zend_property_info * dummy ;
416
416
417
417
/* Trigger the correct error */
418
418
zend_get_property_offset (ce , member , 0 , NULL , & dummy );
419
419
}
420
420
/* }}} */
421
421
422
- ZEND_API zend_property_info * zend_get_property_info (zend_class_entry * ce , zend_string * member , int silent ) /* {{{ */
422
+ ZEND_API zend_property_info * zend_get_property_info (const zend_class_entry * ce , zend_string * member , int silent ) /* {{{ */
423
423
{
424
424
zval * zv ;
425
425
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 ));
@@ -1120,7 +1120,7 @@ ZEND_API zval *zend_std_get_property_ptr_ptr(zend_object *zobj, zend_string *nam
1120
1120
ZEND_API void zend_std_unset_property (zend_object * zobj , zend_string * name , void * * cache_slot ) /* {{{ */
1121
1121
{
1122
1122
uintptr_t property_offset ;
1123
- zend_property_info * prop_info = NULL ;
1123
+ const zend_property_info * prop_info = NULL ;
1124
1124
1125
1125
property_offset = zend_get_property_offset (zobj -> ce , name , (zobj -> ce -> __unset != NULL ), cache_slot , & prop_info );
1126
1126
@@ -1763,7 +1763,7 @@ ZEND_API int zend_std_has_property(zend_object *zobj, zend_string *name, int has
1763
1763
int result ;
1764
1764
zval * value = NULL ;
1765
1765
uintptr_t property_offset ;
1766
- zend_property_info * prop_info = NULL ;
1766
+ const zend_property_info * prop_info = NULL ;
1767
1767
zend_string * tmp_name = NULL ;
1768
1768
1769
1769
property_offset = zend_get_property_offset (zobj -> ce , name , 1 , cache_slot , & prop_info );
0 commit comments