Skip to content

Commit 4852e7f

Browse files
committed
zend_builtin_functions.c: add const qualifiers
1 parent 82866cc commit 4852e7f

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

Zend/zend_builtin_functions.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ ZEND_FUNCTION(get_class)
626626
}
627627

628628
if (!obj) {
629-
zend_class_entry *scope = zend_get_executed_scope();
629+
const zend_class_entry *scope = zend_get_executed_scope();
630630

631631
if (scope) {
632632
zend_error(E_DEPRECATED, "Calling get_class() without arguments is deprecated");
@@ -1026,7 +1026,6 @@ ZEND_FUNCTION(method_exists)
10261026
static void _property_exists(zval *return_value, const zval *object, zend_string *property)
10271027
{
10281028
zend_class_entry *ce;
1029-
zend_property_info *property_info;
10301029

10311030
if (Z_TYPE_P(object) == IS_STRING) {
10321031
ce = zend_lookup_class(Z_STR_P(object));
@@ -1040,7 +1039,7 @@ static void _property_exists(zval *return_value, const zval *object, zend_string
10401039
RETURN_THROWS();
10411040
}
10421041

1043-
property_info = zend_hash_find_ptr(&ce->properties_info, property);
1042+
const zend_property_info *property_info = zend_hash_find_ptr(&ce->properties_info, property);
10441043
if (property_info != NULL
10451044
&& (!(property_info->flags & ZEND_ACC_PRIVATE)
10461045
|| property_info->ce == ce)) {
@@ -1421,15 +1420,14 @@ static inline void get_declared_class_impl(INTERNAL_FUNCTION_PARAMETERS, int fla
14211420
{
14221421
zend_string *key;
14231422
zval *zv;
1424-
zend_class_entry *ce;
14251423

14261424
ZEND_PARSE_PARAMETERS_NONE();
14271425

14281426
array_init(return_value);
14291427
zend_hash_real_init_packed(Z_ARRVAL_P(return_value));
14301428
ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(return_value)) {
14311429
ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(EG(class_table), key, zv) {
1432-
ce = Z_PTR_P(zv);
1430+
const zend_class_entry *ce = Z_PTR_P(zv);
14331431
if ((ce->ce_flags & (ZEND_ACC_LINKED|ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT)) == flags
14341432
&& key
14351433
&& ZSTR_VAL(key)[0] != 0) {

0 commit comments

Comments
 (0)