@@ -188,11 +188,11 @@ static inline reflection_object *reflection_object_from_obj(zend_object *obj) {
188
188
189
189
static zend_object_handlers reflection_object_handlers ;
190
190
191
- static zend_always_inline uint32_t prop_get_flags (property_reference * ref ) {
191
+ static zend_always_inline uint32_t prop_get_flags (const property_reference * ref ) {
192
192
return ref -> prop ? ref -> prop -> flags : ZEND_ACC_PUBLIC ;
193
193
}
194
194
195
- static inline bool is_closure_invoke (zend_class_entry * ce , zend_string * lcname ) {
195
+ static inline bool is_closure_invoke (const zend_class_entry * ce , const zend_string * lcname ) {
196
196
return ce == zend_ce_closure
197
197
&& zend_string_equals_literal (lcname , ZEND_INVOKE_FUNC_NAME );
198
198
}
@@ -302,16 +302,16 @@ static zval *reflection_instantiate(zend_class_entry *pce, zval *object) /* {{{
302
302
}
303
303
/* }}} */
304
304
305
- static void _const_string (smart_str * str , char * name , zval * value , char * indent );
306
- static void _function_string (smart_str * str , zend_function * fptr , zend_class_entry * scope , char * indent );
307
- static void _property_string (smart_str * str , zend_property_info * prop , const char * prop_name , char * indent );
308
- static void _class_const_string (smart_str * str , zend_string * name , zend_class_constant * c , char * indent );
309
- static void _class_string (smart_str * str , zend_class_entry * ce , zval * obj , char * indent );
310
- static void _extension_string (smart_str * str , zend_module_entry * module , char * indent );
311
- static void _zend_extension_string (smart_str * str , zend_extension * extension , char * indent );
305
+ static void _const_string (smart_str * str , const char * name , zval * value , const char * indent );
306
+ static void _function_string (smart_str * str , zend_function * fptr , zend_class_entry * scope , const char * indent );
307
+ static void _property_string (smart_str * str , zend_property_info * prop , const char * prop_name , const char * indent );
308
+ static void _class_const_string (smart_str * str , const zend_string * name , zend_class_constant * c , const char * indent );
309
+ static void _class_string (smart_str * str , zend_class_entry * ce , zval * obj , const char * indent );
310
+ static void _extension_string (smart_str * str , const zend_module_entry * module , const char * indent );
311
+ static void _zend_extension_string (smart_str * str , const zend_extension * extension , const char * indent );
312
312
313
313
/* {{{ _class_string */
314
- static void _class_string (smart_str * str , zend_class_entry * ce , zval * obj , char * indent )
314
+ static void _class_string (smart_str * str , zend_class_entry * ce , zval * obj , const char * indent )
315
315
{
316
316
int count , count_static_props = 0 , count_static_funcs = 0 , count_shadow_props = 0 ;
317
317
zend_string * sub_indent = strpprintf (0 , "%s " , indent );
@@ -543,7 +543,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, char
543
543
/* }}} */
544
544
545
545
/* {{{ _const_string */
546
- static void _const_string (smart_str * str , char * name , zval * value , char * indent )
546
+ static void _const_string (smart_str * str , const char * name , zval * value , const char * indent )
547
547
{
548
548
const char * type = zend_zval_type_name (value );
549
549
uint32_t flags = Z_CONSTANT_FLAGS_P (value );
@@ -592,7 +592,7 @@ static void _const_string(smart_str *str, char *name, zval *value, char *indent)
592
592
/* }}} */
593
593
594
594
/* {{{ _class_const_string */
595
- static void _class_const_string (smart_str * str , zend_string * name , zend_class_constant * c , char * indent )
595
+ static void _class_const_string (smart_str * str , const zend_string * name , zend_class_constant * c , const char * indent )
596
596
{
597
597
if (Z_TYPE (c -> value ) == IS_CONSTANT_AST && zend_update_class_constant (c , name , c -> ce ) == FAILURE ) {
598
598
return ;
@@ -626,10 +626,10 @@ static void _class_const_string(smart_str *str, zend_string *name, zend_class_co
626
626
}
627
627
/* }}} */
628
628
629
- static zend_op * get_recv_op (zend_op_array * op_array , uint32_t offset )
629
+ static zend_op * get_recv_op (const zend_op_array * op_array , uint32_t offset )
630
630
{
631
631
zend_op * op = op_array -> opcodes ;
632
- zend_op * end = op + op_array -> last ;
632
+ const zend_op * end = op + op_array -> last ;
633
633
634
634
++ offset ;
635
635
while (op < end ) {
@@ -772,11 +772,11 @@ static void _function_parameter_string(smart_str *str, zend_function *fptr, char
772
772
/* }}} */
773
773
774
774
/* {{{ _function_closure_string */
775
- static void _function_closure_string (smart_str * str , zend_function * fptr , char * indent )
775
+ static void _function_closure_string (smart_str * str , const zend_function * fptr , const char * indent )
776
776
{
777
777
uint32_t i , count ;
778
- zend_string * key ;
779
- HashTable * static_variables ;
778
+ const zend_string * key ;
779
+ const HashTable * static_variables ;
780
780
781
781
if (fptr -> type != ZEND_USER_FUNCTION || !fptr -> op_array .static_variables ) {
782
782
return ;
@@ -790,7 +790,7 @@ static void _function_closure_string(smart_str *str, zend_function *fptr, char*
790
790
}
791
791
792
792
smart_str_append_printf (str , "\n" );
793
- smart_str_append_printf (str , "%s- Bound Variables [%d ] {\n" , indent , zend_hash_num_elements ( static_variables ) );
793
+ smart_str_append_printf (str , "%s- Bound Variables [%u ] {\n" , indent , count );
794
794
i = 0 ;
795
795
ZEND_HASH_MAP_FOREACH_STR_KEY (static_variables , key ) {
796
796
smart_str_append_printf (str , "%s Variable #%d [ $%s ]\n" , indent , i ++ , ZSTR_VAL (key ));
@@ -800,7 +800,7 @@ static void _function_closure_string(smart_str *str, zend_function *fptr, char*
800
800
/* }}} */
801
801
802
802
/* {{{ _function_string */
803
- static void _function_string (smart_str * str , zend_function * fptr , zend_class_entry * scope , char * indent )
803
+ static void _function_string (smart_str * str , zend_function * fptr , zend_class_entry * scope , const char * indent )
804
804
{
805
805
smart_str param_indent = {0 };
806
806
zend_function * overwrites ;
@@ -923,7 +923,7 @@ static zval *property_get_default(zend_property_info *prop_info) {
923
923
}
924
924
925
925
/* {{{ _property_string */
926
- static void _property_string (smart_str * str , zend_property_info * prop , const char * prop_name , char * indent )
926
+ static void _property_string (smart_str * str , zend_property_info * prop , const char * prop_name , const char * indent )
927
927
{
928
928
if (prop && prop -> doc_comment ) {
929
929
smart_str_append_printf (str , "%s%s\n" , indent , ZSTR_VAL (prop -> doc_comment ));
@@ -986,7 +986,7 @@ static void _property_string(smart_str *str, zend_property_info *prop, const cha
986
986
}
987
987
/* }}} */
988
988
989
- static void _extension_ini_string (zend_ini_entry * ini_entry , smart_str * str , char * indent , int number ) /* {{{ */
989
+ static void _extension_ini_string (const zend_ini_entry * ini_entry , smart_str * str , const char * indent , int number ) /* {{{ */
990
990
{
991
991
char * comma = "" ;
992
992
@@ -1018,7 +1018,7 @@ static void _extension_ini_string(zend_ini_entry *ini_entry, smart_str *str, cha
1018
1018
}
1019
1019
/* }}} */
1020
1020
1021
- static void _extension_class_string (zend_class_entry * ce , zend_string * key , smart_str * str , char * indent , zend_module_entry * module , int * num_classes ) /* {{{ */
1021
+ static void _extension_class_string (zend_class_entry * ce , zend_string * key , smart_str * str , const char * indent , const zend_module_entry * module , int * num_classes ) /* {{{ */
1022
1022
{
1023
1023
if (ce -> type == ZEND_INTERNAL_CLASS && ce -> info .internal .module && !strcasecmp (ce -> info .internal .module -> name , module -> name )) {
1024
1024
/* dump class if it is not an alias */
@@ -1031,7 +1031,7 @@ static void _extension_class_string(zend_class_entry *ce, zend_string *key, smar
1031
1031
}
1032
1032
/* }}} */
1033
1033
1034
- static void _extension_string (smart_str * str , zend_module_entry * module , char * indent ) /* {{{ */
1034
+ static void _extension_string (smart_str * str , const zend_module_entry * module , const char * indent ) /* {{{ */
1035
1035
{
1036
1036
smart_str_append_printf (str , "%sExtension [ " , indent );
1037
1037
if (module -> type == MODULE_PERSISTENT ) {
@@ -1270,7 +1270,7 @@ static void reflect_attributes(INTERNAL_FUNCTION_PARAMETERS, HashTable *attribut
1270
1270
}
1271
1271
/* }}} */
1272
1272
1273
- static void _zend_extension_string (smart_str * str , zend_extension * extension , char * indent ) /* {{{ */
1273
+ static void _zend_extension_string (smart_str * str , const zend_extension * extension , const char * indent ) /* {{{ */
1274
1274
{
1275
1275
smart_str_append_printf (str , "%sZend Extension [ %s " , indent , extension -> name );
1276
1276
0 commit comments