Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- MFH: Constness (Added const qualifier to several function parameters)

  • Loading branch information...
commit cf7384aa4015de9dd21a958146933bbf1f13f0a9 1 parent 0537607
@felipensp felipensp authored
View
12 Zend/zend.c
@@ -63,7 +63,7 @@ ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len TSRML
void (*zend_on_timeout)(int seconds TSRMLS_DC);
static void (*zend_message_dispatcher_p)(long message, void *data);
-static int (*zend_get_configuration_directive_p)(char *name, uint name_length, zval *contents);
+static int (*zend_get_configuration_directive_p)(const char *name, uint name_length, zval *contents);
static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */
{
@@ -803,7 +803,7 @@ void zend_set_utility_values(zend_utility_values *utility_values) /* {{{ */
/* }}} */
/* this should be compatible with the standard zenderror */
-void zenderror(char *error) /* {{{ */
+void zenderror(const char *error) /* {{{ */
{
zend_error(E_PARSE, "%s", error);
}
@@ -826,7 +826,7 @@ ZEND_API void _zend_bailout(char *filename, uint lineno) /* {{{ */
/* }}} */
END_EXTERN_C()
-void zend_append_version_info(zend_extension *extension) /* {{{ */
+void zend_append_version_info(const zend_extension *extension) /* {{{ */
{
char *new_info;
uint new_info_length;
@@ -958,7 +958,7 @@ ZEND_API void zend_message_dispatcher(long message, void *data) /* {{{ */
/* }}} */
END_EXTERN_C()
-ZEND_API int zend_get_configuration_directive(char *name, uint name_length, zval *contents) /* {{{ */
+ZEND_API int zend_get_configuration_directive(const char *name, uint name_length, zval *contents) /* {{{ */
{
if (zend_get_configuration_directive_p) {
return zend_get_configuration_directive_p(name, name_length, contents);
@@ -1148,7 +1148,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((alias("zend_error"),noreturn));
#endif
-ZEND_API void zend_output_debug_string(zend_bool trigger_break, char *format, ...) /* {{{ */
+ZEND_API void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) /* {{{ */
{
#if ZEND_DEBUG
va_list args;
@@ -1245,7 +1245,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
#define COMPILED_STRING_DESCRIPTION_FORMAT "%s(%d) : %s"
-ZEND_API char *zend_make_compiled_string_description(char *name TSRMLS_DC) /* {{{ */
+ZEND_API char *zend_make_compiled_string_description(const char *name TSRMLS_DC) /* {{{ */
{
char *cur_filename;
int cur_lineno;
View
8 Zend/zend.h
@@ -473,7 +473,7 @@ typedef struct _zend_utility_functions {
void (*message_handler)(long message, void *data);
void (*block_interruptions)(void);
void (*unblock_interruptions)(void);
- int (*get_configuration_directive)(char *name, uint name_length, zval *contents);
+ int (*get_configuration_directive)(const char *name, uint name_length, zval *contents);
void (*ticks_function)(int ticks);
void (*on_timeout)(int seconds TSRMLS_DC);
int (*stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
@@ -572,7 +572,7 @@ ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int in
ZEND_API void zend_print_zval_r(zval *expr, int indent TSRMLS_DC);
ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC);
ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent TSRMLS_DC);
-ZEND_API void zend_output_debug_string(zend_bool trigger_break, char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
+ZEND_API void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
END_EXTERN_C()
void zend_activate(TSRMLS_D);
@@ -623,7 +623,7 @@ extern ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_le
ZEND_API void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
-void zenderror(char *error);
+void zenderror(const char *error);
/* The following #define is used for code duality in PHP for Engine 1 & 2 */
#define ZEND_STANDARD_CLASS_DEF_PTR zend_standard_class_def
@@ -641,7 +641,7 @@ END_EXTERN_C()
BEGIN_EXTERN_C()
ZEND_API void zend_message_dispatcher(long message, void *data);
-ZEND_API int zend_get_configuration_directive(char *name, uint name_length, zval *contents);
+ZEND_API int zend_get_configuration_directive(const char *name, uint name_length, zval *contents);
END_EXTERN_C()
/* Messages for applications of Zend */
View
68 Zend/zend_API.c
@@ -219,13 +219,13 @@ ZEND_API char *zend_get_type_by_const(int type) /* {{{ */
}
/* }}} */
-ZEND_API char *zend_zval_type_name(zval *arg) /* {{{ */
+ZEND_API char *zend_zval_type_name(const zval *arg) /* {{{ */
{
return zend_get_type_by_const(Z_TYPE_P(arg));
}
/* }}} */
-ZEND_API zend_class_entry *zend_get_class_entry(zval *zobject TSRMLS_DC) /* {{{ */
+ZEND_API zend_class_entry *zend_get_class_entry(const zval *zobject TSRMLS_DC) /* {{{ */
{
if (Z_OBJ_HT_P(zobject)->get_class_entry) {
return Z_OBJ_HT_P(zobject)->get_class_entry(zobject TSRMLS_CC);
@@ -237,7 +237,7 @@ ZEND_API zend_class_entry *zend_get_class_entry(zval *zobject TSRMLS_DC) /* {{{
/* }}} */
/* returns 1 if you need to copy result, 0 if it's already a copy */
-ZEND_API int zend_get_object_classname(zval *object, char **class_name, zend_uint *class_name_len TSRMLS_DC) /* {{{ */
+ZEND_API int zend_get_object_classname(const zval *object, char **class_name, zend_uint *class_name_len TSRMLS_DC) /* {{{ */
{
if (Z_OBJ_HT_P(object)->get_class_name == NULL ||
Z_OBJ_HT_P(object)->get_class_name(object, class_name, class_name_len, 0 TSRMLS_CC) != SUCCESS) {
@@ -291,7 +291,7 @@ static int parse_arg_object_to_string(zval **arg, char **p, int *pl, int type TS
}
/* }}} */
-static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **spec, char **error, int *severity TSRMLS_DC) /* {{{ */
+static char *zend_parse_arg_impl(int arg_num, zval **arg, const va_list *va, char **spec, char **error, int *severity TSRMLS_DC) /* {{{ */
{
char *spec_walk = *spec;
char c = *spec_walk++;
@@ -617,7 +617,7 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp
}
/* }}} */
-static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int quiet TSRMLS_DC) /* {{{ */
+static int zend_parse_arg(int arg_num, zval **arg, const va_list *va, char **spec, int quiet TSRMLS_DC) /* {{{ */
{
char *expected_type = NULL, *error = NULL;
int severity = E_WARNING;
@@ -647,7 +647,7 @@ static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int
}
/* }}} */
-static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int flags TSRMLS_DC) /* {{{ */
+static int zend_parse_va_args(int num_args, char *type_spec, const va_list *va, int flags TSRMLS_DC) /* {{{ */
{
char *spec_walk;
int c, i;
@@ -871,6 +871,7 @@ ZEND_API int zend_parse_method_parameters(int num_args TSRMLS_DC, zval *this_ptr
object = va_arg(va, zval **);
ce = va_arg(va, zend_class_entry *);
*object = this_ptr;
+
if (ce && !instanceof_function(Z_OBJCE_P(this_ptr), ce TSRMLS_CC)) {
zend_error(E_CORE_ERROR, "%s::%s() must be derived from %s::%s",
ce->name, get_active_function_name(TSRMLS_C), Z_OBJCE_P(this_ptr)->name, get_active_function_name(TSRMLS_C));
@@ -907,6 +908,7 @@ ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args TSRMLS_DC,
object = va_arg(va, zval **);
ce = va_arg(va, zend_class_entry *);
*object = this_ptr;
+
if (ce && !instanceof_function(Z_OBJCE_P(this_ptr), ce TSRMLS_CC)) {
if (!quiet) {
zend_error(E_CORE_ERROR, "%s::%s() must be derived from %s::%s",
@@ -933,7 +935,7 @@ ZEND_API int _array_init(zval *arg, uint size ZEND_FILE_LINE_DC) /* {{{ */
}
/* }}} */
-static int zend_merge_property(zval **value TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int zend_merge_property(zval **value TSRMLS_DC, int num_args, va_list args, const zend_hash_key *hash_key) /* {{{ */
{
/* which name should a numeric property have ? */
if (hash_key->nKeyLength) {
@@ -1396,7 +1398,7 @@ ZEND_API int add_get_index_stringl(zval *arg, ulong index, const char *str, uint
}
/* }}} */
-ZEND_API int add_property_long_ex(zval *arg, char *key, uint key_len, long n TSRMLS_DC) /* {{{ */
+ZEND_API int add_property_long_ex(zval *arg, const char *key, uint key_len, long n TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
@@ -1414,7 +1416,7 @@ ZEND_API int add_property_long_ex(zval *arg, char *key, uint key_len, long n TSR
}
/* }}} */
-ZEND_API int add_property_bool_ex(zval *arg, char *key, uint key_len, int b TSRMLS_DC) /* {{{ */
+ZEND_API int add_property_bool_ex(zval *arg, const char *key, uint key_len, int b TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
@@ -1432,7 +1434,7 @@ ZEND_API int add_property_bool_ex(zval *arg, char *key, uint key_len, int b TSRM
}
/* }}} */
-ZEND_API int add_property_null_ex(zval *arg, char *key, uint key_len TSRMLS_DC) /* {{{ */
+ZEND_API int add_property_null_ex(zval *arg, const char *key, uint key_len TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
@@ -1450,7 +1452,7 @@ ZEND_API int add_property_null_ex(zval *arg, char *key, uint key_len TSRMLS_DC)
}
/* }}} */
-ZEND_API int add_property_resource_ex(zval *arg, char *key, uint key_len, long n TSRMLS_DC) /* {{{ */
+ZEND_API int add_property_resource_ex(zval *arg, const char *key, uint key_len, long n TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
@@ -1468,7 +1470,7 @@ ZEND_API int add_property_resource_ex(zval *arg, char *key, uint key_len, long n
}
/* }}} */
-ZEND_API int add_property_double_ex(zval *arg, char *key, uint key_len, double d TSRMLS_DC) /* {{{ */
+ZEND_API int add_property_double_ex(zval *arg, const char *key, uint key_len, double d TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
@@ -1486,7 +1488,7 @@ ZEND_API int add_property_double_ex(zval *arg, char *key, uint key_len, double d
}
/* }}} */
-ZEND_API int add_property_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate TSRMLS_DC) /* {{{ */
+ZEND_API int add_property_string_ex(zval *arg, const char *key, uint key_len, char *str, int duplicate TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
@@ -1504,7 +1506,7 @@ ZEND_API int add_property_string_ex(zval *arg, char *key, uint key_len, char *st
}
/* }}} */
-ZEND_API int add_property_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate TSRMLS_DC) /* {{{ */
+ZEND_API int add_property_stringl_ex(zval *arg, const char *key, uint key_len, char *str, uint length, int duplicate TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
@@ -1522,7 +1524,7 @@ ZEND_API int add_property_stringl_ex(zval *arg, char *key, uint key_len, char *s
}
/* }}} */
-ZEND_API int add_property_zval_ex(zval *arg, char *key, uint key_len, zval *value TSRMLS_DC) /* {{{ */
+ZEND_API int add_property_zval_ex(zval *arg, const char *key, uint key_len, zval *value TSRMLS_DC) /* {{{ */
{
zval *z_key;
@@ -1702,7 +1704,7 @@ ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *mod
}
/* }}} */
-ZEND_API void zend_check_magic_method_implementation(zend_class_entry *ce, zend_function *fptr, int error_type TSRMLS_DC) /* {{{ */
+ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce, const zend_function *fptr, int error_type TSRMLS_DC) /* {{{ */
{
char lcname[16];
int name_len;
@@ -2043,7 +2045,7 @@ ZEND_API int zend_startup_module(zend_module_entry *module) /* {{{ */
}
/* }}} */
-ZEND_API int zend_get_module_started(char *module_name) /* {{{ */
+ZEND_API int zend_get_module_started(const char *module_name) /* {{{ */
{
zend_module_entry *module;
@@ -2122,7 +2124,7 @@ int module_registry_cleanup(zend_module_entry *module TSRMLS_DC) /* {{{ */
}
/* }}} */
-int module_registry_unload_temp(zend_module_entry *module TSRMLS_DC) /* {{{ */
+int module_registry_unload_temp(const zend_module_entry *module TSRMLS_DC) /* {{{ */
{
return (module->type == MODULE_TEMPORARY) ? ZEND_HASH_APPLY_REMOVE : ZEND_HASH_APPLY_STOP;
}
@@ -2213,7 +2215,7 @@ ZEND_API zend_class_entry *zend_register_internal_interface(zend_class_entry *or
}
/* }}} */
-ZEND_API int zend_register_class_alias_ex(char *name, int name_len, zend_class_entry *ce TSRMLS_DC) /* {{{ */
+ZEND_API int zend_register_class_alias_ex(const char *name, int name_len, zend_class_entry *ce TSRMLS_DC) /* {{{ */
{
char *lcname = zend_str_tolower_dup(name, name_len);
int ret;
@@ -2227,7 +2229,7 @@ ZEND_API int zend_register_class_alias_ex(char *name, int name_len, zend_class_e
}
/* }}} */
-ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length, zend_bool is_ref, int num_symbol_tables, ...) /* {{{ */
+ZEND_API int zend_set_hash_symbol(zval *symbol, const char *name, int name_length, zend_bool is_ref, int num_symbol_tables, ...) /* {{{ */
{
HashTable *symbol_table;
va_list symbol_table_list;
@@ -2304,7 +2306,7 @@ ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_
}
/* }}} */
-static int zend_is_callable_check_class(char *name, int name_len, zend_fcall_info_cache *fcc, char **error TSRMLS_DC) /* {{{ */
+static int zend_is_callable_check_class(const char *name, int name_len, zend_fcall_info_cache *fcc, char **error TSRMLS_DC) /* {{{ */
{
int ret = 0;
zend_class_entry **pce;
@@ -2962,7 +2964,7 @@ ZEND_API const char *zend_get_module_version(const char *module_name) /* {{{ */
}
/* }}} */
-ZEND_API int zend_declare_property_ex(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type, char *doc_comment, int doc_comment_len TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_property_ex(zend_class_entry *ce, const char *name, int name_length, zval *property, int access_type, char *doc_comment, int doc_comment_len TSRMLS_DC) /* {{{ */
{
zend_property_info property_info;
HashTable *target_symbol_table;
@@ -3134,13 +3136,13 @@ ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, char *name, int
}
/* }}} */
-ZEND_API int zend_declare_class_constant(zend_class_entry *ce, char *name, size_t name_length, zval *value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_class_constant(zend_class_entry *ce, const char *name, size_t name_length, zval *value TSRMLS_DC) /* {{{ */
{
return zend_hash_update(&ce->constants_table, name, name_length+1, &value, sizeof(zval *), NULL);
}
/* }}} */
-ZEND_API int zend_declare_class_constant_null(zend_class_entry *ce, char *name, size_t name_length TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_class_constant_null(zend_class_entry *ce, const char *name, size_t name_length TSRMLS_DC) /* {{{ */
{
zval *constant;
@@ -3155,7 +3157,7 @@ ZEND_API int zend_declare_class_constant_null(zend_class_entry *ce, char *name,
}
/* }}} */
-ZEND_API int zend_declare_class_constant_long(zend_class_entry *ce, char *name, size_t name_length, long value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_class_constant_long(zend_class_entry *ce, const char *name, size_t name_length, long value TSRMLS_DC) /* {{{ */
{
zval *constant;
@@ -3170,7 +3172,7 @@ ZEND_API int zend_declare_class_constant_long(zend_class_entry *ce, char *name,
}
/* }}} */
-ZEND_API int zend_declare_class_constant_bool(zend_class_entry *ce, char *name, size_t name_length, zend_bool value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_bool value TSRMLS_DC) /* {{{ */
{
zval *constant;
@@ -3185,7 +3187,7 @@ ZEND_API int zend_declare_class_constant_bool(zend_class_entry *ce, char *name,
}
/* }}} */
-ZEND_API int zend_declare_class_constant_double(zend_class_entry *ce, char *name, size_t name_length, double value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_class_constant_double(zend_class_entry *ce, const char *name, size_t name_length, double value TSRMLS_DC) /* {{{ */
{
zval *constant;
@@ -3200,7 +3202,7 @@ ZEND_API int zend_declare_class_constant_double(zend_class_entry *ce, char *name
}
/* }}} */
-ZEND_API int zend_declare_class_constant_stringl(zend_class_entry *ce, char *name, size_t name_length, char *value, size_t value_length TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_class_constant_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_length TSRMLS_DC) /* {{{ */
{
zval *constant;
@@ -3216,7 +3218,7 @@ ZEND_API int zend_declare_class_constant_stringl(zend_class_entry *ce, char *nam
}
/* }}} */
-ZEND_API int zend_declare_class_constant_string(zend_class_entry *ce, char *name, size_t name_length, char *value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_class_constant_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value TSRMLS_DC) /* {{{ */
{
return zend_declare_class_constant_stringl(ce, name, name_length, value, strlen(value) TSRMLS_CC);
}
@@ -3294,7 +3296,7 @@ ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object,
}
/* }}} */
-ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, char *name, int name_length, char *value TSRMLS_DC) /* {{{ */
+ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, char *name, int name_length, const char *value TSRMLS_DC) /* {{{ */
{
zval *tmp;
@@ -3306,7 +3308,7 @@ ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object,
}
/* }}} */
-ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC) /* {{{ */
+ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, const char *value, int value_len TSRMLS_DC) /* {{{ */
{
zval *tmp;
@@ -3401,7 +3403,7 @@ ZEND_API int zend_update_static_property_double(zend_class_entry *scope, char *n
}
/* }}} */
-ZEND_API int zend_update_static_property_string(zend_class_entry *scope, char *name, int name_length, char *value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_update_static_property_string(zend_class_entry *scope, char *name, int name_length, const char *value TSRMLS_DC) /* {{{ */
{
zval *tmp;
@@ -3413,7 +3415,7 @@ ZEND_API int zend_update_static_property_string(zend_class_entry *scope, char *n
}
/* }}} */
-ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, char *name, int name_length, char *value, int value_len TSRMLS_DC) /* {{{ */
+ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, char *name, int name_length, const char *value, int value_len TSRMLS_DC) /* {{{ */
{
zval *tmp;
View
54 Zend/zend_API.h
@@ -237,7 +237,7 @@ ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array TS
#define ZEND_PARSE_PARAMS_QUIET 1<<1
ZEND_API int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...);
ZEND_API int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, char *type_spec, ...);
-ZEND_API char *zend_zval_type_name(zval *arg);
+ZEND_API char *zend_zval_type_name(const zval *arg);
ZEND_API int zend_parse_method_parameters(int num_args TSRMLS_DC, zval *this_ptr, char *type_spec, ...);
ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args TSRMLS_DC, zval *this_ptr, char *type_spec, ...);
@@ -251,14 +251,14 @@ ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *mod
ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TSRMLS_DC);
ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC);
ZEND_API int zend_startup_modules(TSRMLS_D);
-ZEND_API void zend_check_magic_method_implementation(zend_class_entry *ce, zend_function *fptr, int error_type TSRMLS_DC);
+ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce, const zend_function *fptr, int error_type TSRMLS_DC);
ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_entry TSRMLS_DC);
ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce, char *parent_name TSRMLS_DC);
ZEND_API zend_class_entry *zend_register_internal_interface(zend_class_entry *orig_class_entry TSRMLS_DC);
ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int num_interfaces, ...);
-ZEND_API int zend_register_class_alias_ex(char *name, int name_len, zend_class_entry *ce TSRMLS_DC);
+ZEND_API int zend_register_class_alias_ex(const char *name, int name_len, zend_class_entry *ce TSRMLS_DC);
#define zend_register_class_alias(name, ce) \
zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_DC)
@@ -281,9 +281,9 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval **object_pp, uint ch
ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, char **callable_name TSRMLS_DC);
ZEND_API zend_bool zend_make_callable(zval *callable, char **callable_name TSRMLS_DC);
ZEND_API const char *zend_get_module_version(const char *module_name);
-ZEND_API int zend_get_module_started(char *module_name);
+ZEND_API int zend_get_module_started(const char *module_name);
ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type TSRMLS_DC);
-ZEND_API int zend_declare_property_ex(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type, char *doc_comment, int doc_comment_len TSRMLS_DC);
+ZEND_API int zend_declare_property_ex(zend_class_entry *ce, const char *name, int name_length, zval *property, int access_type, char *doc_comment, int doc_comment_len TSRMLS_DC);
ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC);
@@ -291,13 +291,13 @@ ZEND_API int zend_declare_property_double(zend_class_entry *ce, char *name, int
ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int name_length, char *value, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, char *name, int name_length, char *value, int value_len, int access_type TSRMLS_DC);
-ZEND_API int zend_declare_class_constant(zend_class_entry *ce, char *name, size_t name_length, zval *value TSRMLS_DC);
-ZEND_API int zend_declare_class_constant_null(zend_class_entry *ce, char *name, size_t name_length TSRMLS_DC);
-ZEND_API int zend_declare_class_constant_long(zend_class_entry *ce, char *name, size_t name_length, long value TSRMLS_DC);
-ZEND_API int zend_declare_class_constant_bool(zend_class_entry *ce, char *name, size_t name_length, zend_bool value TSRMLS_DC);
-ZEND_API int zend_declare_class_constant_double(zend_class_entry *ce, char *name, size_t name_length, double value TSRMLS_DC);
-ZEND_API int zend_declare_class_constant_stringl(zend_class_entry *ce, char *name, size_t name_length, char *value, size_t value_length TSRMLS_DC);
-ZEND_API int zend_declare_class_constant_string(zend_class_entry *ce, char *name, size_t name_length, char *value TSRMLS_DC);
+ZEND_API int zend_declare_class_constant(zend_class_entry *ce, const char *name, size_t name_length, zval *value TSRMLS_DC);
+ZEND_API int zend_declare_class_constant_null(zend_class_entry *ce, const char *name, size_t name_length TSRMLS_DC);
+ZEND_API int zend_declare_class_constant_long(zend_class_entry *ce, const char *name, size_t name_length, long value TSRMLS_DC);
+ZEND_API int zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_bool value TSRMLS_DC);
+ZEND_API int zend_declare_class_constant_double(zend_class_entry *ce, const char *name, size_t name_length, double value TSRMLS_DC);
+ZEND_API int zend_declare_class_constant_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_length TSRMLS_DC);
+ZEND_API int zend_declare_class_constant_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value TSRMLS_DC);
ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC);
ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *name, int name_length, zval *value TSRMLS_DC);
@@ -305,23 +305,23 @@ ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, c
ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC);
ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC);
ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC);
-ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, char *name, int name_length, char *value TSRMLS_DC);
-ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_length TSRMLS_DC);
+ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, char *name, int name_length, const char *value TSRMLS_DC);
+ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, const char *value, int value_length TSRMLS_DC);
ZEND_API int zend_update_static_property(zend_class_entry *scope, char *name, int name_length, zval *value TSRMLS_DC);
ZEND_API int zend_update_static_property_null(zend_class_entry *scope, char *name, int name_length TSRMLS_DC);
ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC);
ZEND_API int zend_update_static_property_long(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC);
ZEND_API int zend_update_static_property_double(zend_class_entry *scope, char *name, int name_length, double value TSRMLS_DC);
-ZEND_API int zend_update_static_property_string(zend_class_entry *scope, char *name, int name_length, char *value TSRMLS_DC);
-ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, char *name, int name_length, char *value, int value_length TSRMLS_DC);
+ZEND_API int zend_update_static_property_string(zend_class_entry *scope, char *name, int name_length, const char *value TSRMLS_DC);
+ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, char *name, int name_length, const char *value, int value_length TSRMLS_DC);
ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *name, int name_length, zend_bool silent TSRMLS_DC);
ZEND_API zval *zend_read_static_property(zend_class_entry *scope, char *name, int name_length, zend_bool silent TSRMLS_DC);
-ZEND_API zend_class_entry *zend_get_class_entry(zval *zobject TSRMLS_DC);
-ZEND_API int zend_get_object_classname(zval *object, char **class_name, zend_uint *class_name_len TSRMLS_DC);
+ZEND_API zend_class_entry *zend_get_class_entry(const zval *zobject TSRMLS_DC);
+ZEND_API int zend_get_object_classname(const zval *object, char **class_name, zend_uint *class_name_len TSRMLS_DC);
ZEND_API char *zend_get_type_by_const(int type);
#define getThis() (this_ptr)
@@ -405,14 +405,14 @@ ZEND_API int add_get_index_double(zval *arg, ulong idx, double d, void **dest);
ZEND_API int add_get_index_string(zval *arg, ulong idx, const char *str, void **dest, int duplicate);
ZEND_API int add_get_index_stringl(zval *arg, ulong idx, const char *str, uint length, void **dest, int duplicate);
-ZEND_API int add_property_long_ex(zval *arg, char *key, uint key_len, long l TSRMLS_DC);
-ZEND_API int add_property_null_ex(zval *arg, char *key, uint key_len TSRMLS_DC);
-ZEND_API int add_property_bool_ex(zval *arg, char *key, uint key_len, int b TSRMLS_DC);
-ZEND_API int add_property_resource_ex(zval *arg, char *key, uint key_len, long r TSRMLS_DC);
-ZEND_API int add_property_double_ex(zval *arg, char *key, uint key_len, double d TSRMLS_DC);
-ZEND_API int add_property_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate TSRMLS_DC);
-ZEND_API int add_property_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate TSRMLS_DC);
-ZEND_API int add_property_zval_ex(zval *arg, char *key, uint key_len, zval *value TSRMLS_DC);
+ZEND_API int add_property_long_ex(zval *arg, const char *key, uint key_len, long l TSRMLS_DC);
+ZEND_API int add_property_null_ex(zval *arg, const char *key, uint key_len TSRMLS_DC);
+ZEND_API int add_property_bool_ex(zval *arg, const char *key, uint key_len, int b TSRMLS_DC);
+ZEND_API int add_property_resource_ex(zval *arg, const char *key, uint key_len, long r TSRMLS_DC);
+ZEND_API int add_property_double_ex(zval *arg, const char *key, uint key_len, double d TSRMLS_DC);
+ZEND_API int add_property_string_ex(zval *arg, const char *key, uint key_len, char *str, int duplicate TSRMLS_DC);
+ZEND_API int add_property_stringl_ex(zval *arg, const char *key, uint key_len, char *str, uint length, int duplicate TSRMLS_DC);
+ZEND_API int add_property_zval_ex(zval *arg, const char *key, uint key_len, zval *value TSRMLS_DC);
#define add_property_long(__arg, __key, __n) add_property_long_ex(__arg, __key, strlen(__key)+1, __n TSRMLS_CC)
#define add_property_null(__arg, __key) add_property_null_ex(__arg, __key, strlen(__key) + 1 TSRMLS_CC)
@@ -486,7 +486,7 @@ ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *f
ZEND_API int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TSRMLS_DC);
-ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length, zend_bool is_ref, int num_symbol_tables, ...);
+ZEND_API int zend_set_hash_symbol(zval *symbol, const char *name, int name_length, zend_bool is_ref, int num_symbol_tables, ...);
ZEND_API int zend_delete_global_variable(char *name, int name_len TSRMLS_DC);
View
188 Zend/zend_compile.c
@@ -69,7 +69,7 @@ static void zend_destroy_property_info_internal(zend_property_info *property_inf
free(property_info->name);
}
-static void build_runtime_defined_function_key(zval *result, char *name, int name_length TSRMLS_DC)
+static void build_runtime_defined_function_key(zval *result, const char *name, int name_length TSRMLS_DC)
{
char char_pos_buf[32];
uint char_pos_len;
@@ -104,7 +104,7 @@ int zend_auto_global_arm(zend_auto_global *auto_global TSRMLS_DC)
}
-ZEND_API int zend_auto_global_disable_jit(char *varname, zend_uint varname_length TSRMLS_DC)
+ZEND_API int zend_auto_global_disable_jit(const char *varname, zend_uint varname_length TSRMLS_DC)
{
zend_auto_global *auto_global;
@@ -195,7 +195,7 @@ void shutdown_compiler(TSRMLS_D)
}
-ZEND_API char *zend_set_compiled_filename(char *new_compiled_filename TSRMLS_DC)
+ZEND_API char *zend_set_compiled_filename(const char *new_compiled_filename TSRMLS_DC)
{
char **pp, *p;
int length = strlen(new_compiled_filename);
@@ -267,7 +267,7 @@ static int lookup_cv(zend_op_array *op_array, char* name, int name_len)
}
-void zend_do_binary_op(zend_uchar op, znode *result, znode *op1, znode *op2 TSRMLS_DC)
+void zend_do_binary_op(zend_uchar op, znode *result, const znode *op1, const znode *op2 TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -280,7 +280,7 @@ void zend_do_binary_op(zend_uchar op, znode *result, znode *op1, znode *op2 TSRM
}
-void zend_do_unary_op(zend_uchar op, znode *result, znode *op1 TSRMLS_DC)
+void zend_do_unary_op(zend_uchar op, znode *result, const znode *op1 TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -295,14 +295,14 @@ void zend_do_unary_op(zend_uchar op, znode *result, znode *op1 TSRMLS_DC)
#define MAKE_NOP(opline) { opline->opcode = ZEND_NOP; memset(&opline->result,0,sizeof(znode)); memset(&opline->op1,0,sizeof(znode)); memset(&opline->op2,0,sizeof(znode)); opline->result.op_type=opline->op1.op_type=opline->op2.op_type=IS_UNUSED; }
-static void zend_do_op_data(zend_op *data_op, znode *value TSRMLS_DC)
+static void zend_do_op_data(zend_op *data_op, const znode *value TSRMLS_DC)
{
data_op->opcode = ZEND_OP_DATA;
data_op->op1 = *value;
SET_UNUSED(data_op->op2);
}
-void zend_do_binary_assign_op(zend_uchar op, znode *result, znode *op1, znode *op2 TSRMLS_DC)
+void zend_do_binary_assign_op(zend_uchar op, znode *result, const znode *op1, const znode *op2 TSRMLS_DC)
{
int last_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -462,7 +462,7 @@ void fetch_array_begin(znode *result, znode *varname, znode *first_dim TSRMLS_DC
}
-void fetch_array_dim(znode *result, znode *parent, znode *dim TSRMLS_DC)
+void fetch_array_dim(znode *result, const znode *parent, const znode *dim TSRMLS_DC)
{
zend_op opline;
zend_llist *fetch_list_ptr;
@@ -482,7 +482,7 @@ void fetch_array_dim(znode *result, znode *parent, znode *dim TSRMLS_DC)
}
-void fetch_string_offset(znode *result, znode *parent, znode *offset TSRMLS_DC)
+void fetch_string_offset(znode *result, const znode *parent, const znode *offset TSRMLS_DC)
{
#ifdef ilia_0
zend_error(E_DEPRECATED, "Usage of {} to access string offsets is deprecated and will be removed in PHP 6");
@@ -491,7 +491,7 @@ void fetch_string_offset(znode *result, znode *parent, znode *offset TSRMLS_DC)
}
-void zend_do_print(znode *result, znode *arg TSRMLS_DC)
+void zend_do_print(znode *result, const znode *arg TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -504,7 +504,7 @@ void zend_do_print(znode *result, znode *arg TSRMLS_DC)
}
-void zend_do_echo(znode *arg TSRMLS_DC)
+void zend_do_echo(const znode *arg TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -513,7 +513,7 @@ void zend_do_echo(znode *arg TSRMLS_DC)
SET_UNUSED(opline->op2);
}
-void zend_do_abstract_method(znode *function_name, znode *modifiers, znode *body TSRMLS_DC)
+void zend_do_abstract_method(const znode *function_name, znode *modifiers, const znode *body TSRMLS_DC)
{
char *method_type;
@@ -545,7 +545,7 @@ void zend_do_abstract_method(znode *function_name, znode *modifiers, znode *body
}
}
-static zend_bool opline_is_fetch_this(zend_op *opline TSRMLS_DC)
+static zend_bool opline_is_fetch_this(const zend_op *opline TSRMLS_DC)
{
if ((opline->opcode == ZEND_FETCH_W) && (opline->op1.op_type == IS_CONST)
&& (opline->op1.u.constant.type == IS_STRING)
@@ -557,7 +557,7 @@ static zend_bool opline_is_fetch_this(zend_op *opline TSRMLS_DC)
}
}
-void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC)
+void zend_do_assign(znode *result, znode *variable, const znode *value TSRMLS_DC)
{
int last_op_number;
zend_op *opline;
@@ -653,14 +653,14 @@ void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC)
*result = opline->result;
}
-static inline zend_bool zend_is_function_or_method_call(znode *variable)
+static inline zend_bool zend_is_function_or_method_call(const znode *variable)
{
zend_uint type = variable->u.EA.type;
return ((type & ZEND_PARSED_METHOD_CALL) || (type == ZEND_PARSED_FUNCTION_CALL));
}
-void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar TSRMLS_DC)
+void zend_do_assign_ref(znode *result, const znode *lvar, const znode *rvar TSRMLS_DC)
{
zend_op *opline;
@@ -729,7 +729,7 @@ static inline void do_end_loop(int cont_addr, int has_loop_var TSRMLS_DC)
}
-void zend_do_while_cond(znode *expr, znode *close_bracket_token TSRMLS_DC)
+void zend_do_while_cond(const znode *expr, znode *close_bracket_token TSRMLS_DC)
{
int while_cond_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -744,7 +744,7 @@ void zend_do_while_cond(znode *expr, znode *close_bracket_token TSRMLS_DC)
}
-void zend_do_while_end(znode *while_token, znode *close_bracket_token TSRMLS_DC)
+void zend_do_while_end(const znode *while_token, const znode *close_bracket_token TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -763,7 +763,7 @@ void zend_do_while_end(znode *while_token, znode *close_bracket_token TSRMLS_DC)
}
-void zend_do_for_cond(znode *expr, znode *second_semicolon_token TSRMLS_DC)
+void zend_do_for_cond(const znode *expr, znode *second_semicolon_token TSRMLS_DC)
{
int for_cond_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -775,7 +775,7 @@ void zend_do_for_cond(znode *expr, znode *second_semicolon_token TSRMLS_DC)
}
-void zend_do_for_before_statement(znode *cond_start, znode *second_semicolon_token TSRMLS_DC)
+void zend_do_for_before_statement(const znode *cond_start, const znode *second_semicolon_token TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -791,7 +791,7 @@ void zend_do_for_before_statement(znode *cond_start, znode *second_semicolon_tok
}
-void zend_do_for_end(znode *second_semicolon_token TSRMLS_DC)
+void zend_do_for_end(const znode *second_semicolon_token TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -807,7 +807,7 @@ void zend_do_for_end(znode *second_semicolon_token TSRMLS_DC)
}
-void zend_do_pre_incdec(znode *result, znode *op1, zend_uchar op TSRMLS_DC)
+void zend_do_pre_incdec(znode *result, const znode *op1, zend_uchar op TSRMLS_DC)
{
int last_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline;
@@ -836,7 +836,7 @@ void zend_do_pre_incdec(znode *result, znode *op1, zend_uchar op TSRMLS_DC)
}
-void zend_do_post_incdec(znode *result, znode *op1, zend_uchar op TSRMLS_DC)
+void zend_do_post_incdec(znode *result, const znode *op1, zend_uchar op TSRMLS_DC)
{
int last_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline;
@@ -863,7 +863,7 @@ void zend_do_post_incdec(znode *result, znode *op1, zend_uchar op TSRMLS_DC)
}
-void zend_do_if_cond(znode *cond, znode *closing_bracket_token TSRMLS_DC)
+void zend_do_if_cond(const znode *cond, znode *closing_bracket_token TSRMLS_DC)
{
int if_cond_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -876,7 +876,7 @@ void zend_do_if_cond(znode *cond, znode *closing_bracket_token TSRMLS_DC)
}
-void zend_do_if_after_statement(znode *closing_bracket_token, unsigned char initialize TSRMLS_DC)
+void zend_do_if_after_statement(const znode *closing_bracket_token, unsigned char initialize TSRMLS_DC)
{
int if_end_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -914,7 +914,7 @@ void zend_do_if_end(TSRMLS_D)
DEC_BPC(CG(active_op_array));
}
-void zend_check_writable_variable(znode *variable)
+void zend_check_writable_variable(const znode *variable)
{
zend_uint type = variable->u.EA.type;
@@ -1022,7 +1022,7 @@ void zend_do_end_variable_parse(znode *variable, int type, int arg_offset TSRMLS
}
-void zend_do_add_string(znode *result, znode *op1, znode *op2 TSRMLS_DC)
+void zend_do_add_string(znode *result, const znode *op1, znode *op2 TSRMLS_DC)
{
zend_op *opline;
@@ -1055,7 +1055,7 @@ void zend_do_add_string(znode *result, znode *op1, znode *op2 TSRMLS_DC)
}
-void zend_do_add_variable(znode *result, znode *op1, znode *op2 TSRMLS_DC)
+void zend_do_add_variable(znode *result, const znode *op1, const znode *op2 TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -1116,7 +1116,7 @@ void zend_do_free(znode *op1 TSRMLS_DC)
}
-int zend_do_verify_access_types(znode *current_access_type, znode *new_modifier)
+int zend_do_verify_access_types(const znode *current_access_type, const znode *new_modifier)
{
if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_PPP_MASK)
&& (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_PPP_MASK)) {
@@ -1416,7 +1416,7 @@ void zend_do_handle_exception(TSRMLS_D)
}
-void zend_do_end_function_declaration(znode *function_token TSRMLS_DC)
+void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC)
{
char lcname[16];
int name_len;
@@ -1450,7 +1450,7 @@ void zend_do_end_function_declaration(znode *function_token TSRMLS_DC)
}
-void zend_do_receive_arg(zend_uchar op, znode *var, znode *offset, znode *initialization, znode *class_type, znode *varname, zend_uchar pass_by_reference TSRMLS_DC)
+void zend_do_receive_arg(zend_uchar op, const znode *var, const znode *offset, const znode *initialization, znode *class_type, const znode *varname, zend_uchar pass_by_reference TSRMLS_DC)
{
zend_op *opline;
zend_arg_info *cur_arg_info;
@@ -1612,7 +1612,7 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC)
}
-void zend_do_clone(znode *result, znode *expr TSRMLS_DC)
+void zend_do_clone(znode *result, const znode *expr TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -1872,7 +1872,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2
}
/* }}} */
-void zend_do_goto(znode *label TSRMLS_DC) /* {{{ */
+void zend_do_goto(const znode *label TSRMLS_DC) /* {{{ */
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -2007,7 +2007,7 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na
}
-void zend_do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC)
+void zend_do_end_function_call(znode *function_name, znode *result, const znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC)
{
zend_op *opline;
@@ -2137,7 +2137,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
}
-static int generate_free_switch_expr(zend_switch_entry *switch_entry TSRMLS_DC)
+static int generate_free_switch_expr(const zend_switch_entry *switch_entry TSRMLS_DC)
{
zend_op *opline;
@@ -2154,7 +2154,7 @@ static int generate_free_switch_expr(zend_switch_entry *switch_entry TSRMLS_DC)
return 0;
}
-static int generate_free_foreach_copy(zend_op *foreach_copy TSRMLS_DC)
+static int generate_free_foreach_copy(const zend_op *foreach_copy TSRMLS_DC)
{
zend_op *opline;
@@ -2251,7 +2251,7 @@ void zend_do_first_catch(znode *open_parentheses TSRMLS_DC)
}
-void zend_initialize_try_catch_element(znode *try_token TSRMLS_DC)
+void zend_initialize_try_catch_element(const znode *try_token TSRMLS_DC)
{
int jmp_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -2272,7 +2272,7 @@ void zend_initialize_try_catch_element(znode *try_token TSRMLS_DC)
}
-void zend_do_mark_last_catch(znode *first_catch, znode *last_additional_catch TSRMLS_DC)
+void zend_do_mark_last_catch(const znode *first_catch, const znode *last_additional_catch TSRMLS_DC)
{
CG(active_op_array)->last--;
zend_do_if_end(TSRMLS_C);
@@ -2294,7 +2294,7 @@ void zend_do_try(znode *try_token TSRMLS_DC)
}
-void zend_do_begin_catch(znode *try_token, znode *class_name, znode *catch_var, znode *first_catch TSRMLS_DC)
+void zend_do_begin_catch(znode *try_token, znode *class_name, const znode *catch_var, znode *first_catch TSRMLS_DC)
{
long catch_op_number;
zend_op *opline;
@@ -2326,7 +2326,7 @@ void zend_do_begin_catch(znode *try_token, znode *class_name, znode *catch_var,
try_token->u.opline_num = catch_op_number;
}
-void zend_do_end_catch(znode *try_token TSRMLS_DC)
+void zend_do_end_catch(const znode *try_token TSRMLS_DC)
{
int jmp_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -2343,7 +2343,7 @@ void zend_do_end_catch(znode *try_token TSRMLS_DC)
CG(active_op_array)->opcodes[try_token->u.opline_num].extended_value = get_next_op_number(CG(active_op_array));
}
-void zend_do_throw(znode *expr TSRMLS_DC)
+void zend_do_throw(const znode *expr TSRMLS_DC)
{
zend_op *opline;
@@ -2484,7 +2484,7 @@ static void do_inherit_method(zend_function *function)
}
-static zend_bool zend_do_perform_implementation_check(zend_function *fe, zend_function *proto)
+static zend_bool zend_do_perform_implementation_check(const zend_function *fe, const zend_function *proto)
{
zend_uint i;
@@ -2549,7 +2549,7 @@ static zend_bool zend_do_perform_implementation_check(zend_function *fe, zend_fu
}
-static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_function *parent, zend_hash_key *hash_key, zend_class_entry *child_ce)
+static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_function *parent, const zend_hash_key *hash_key, zend_class_entry *child_ce)
{
zend_uint child_flags;
zend_uint parent_flags = parent->common.fn_flags;
@@ -2629,7 +2629,7 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
}
-static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_property_info *parent_info, zend_hash_key *hash_key, zend_class_entry *ce)
+static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_property_info *parent_info, const zend_hash_key *hash_key, zend_class_entry *ce)
{
zend_property_info *child_info;
zend_class_entry *parent_ce = ce->parent;
@@ -2720,7 +2720,7 @@ static inline void do_implement_interface(zend_class_entry *ce, zend_class_entry
}
-ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC)
+ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_entry *iface TSRMLS_DC)
{
/* expects interface to be contained in ce's interface list already */
zend_uint i, ce_num, if_num = iface->num_interfaces;
@@ -2756,7 +2756,7 @@ ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, zend_class_entry
}
}
-static int inherit_static_prop(zval **p TSRMLS_DC, int num_args, va_list args, zend_hash_key *key)
+static int inherit_static_prop(zval **p TSRMLS_DC, int num_args, va_list args, const zend_hash_key *key)
{
HashTable *target = va_arg(args, HashTable*);
@@ -2807,7 +2807,7 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
}
-static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zval **parent_constant, zend_hash_key *hash_key, zend_class_entry *iface)
+static zend_bool do_inherit_constant_check(HashTable *child_constants_table, const zval **parent_constant, const zend_hash_key *hash_key, const zend_class_entry *iface)
{
zval **old_constant;
@@ -2890,7 +2890,7 @@ ZEND_API int do_bind_function(zend_op *opline, HashTable *function_table, zend_b
}
-ZEND_API zend_class_entry *do_bind_class(zend_op *opline, HashTable *class_table, zend_bool compile_time TSRMLS_DC)
+ZEND_API zend_class_entry *do_bind_class(const zend_op *opline, HashTable *class_table, zend_bool compile_time TSRMLS_DC)
{
zend_class_entry *ce, **pce;
@@ -2921,7 +2921,7 @@ ZEND_API zend_class_entry *do_bind_class(zend_op *opline, HashTable *class_table
}
-ZEND_API zend_class_entry *do_bind_inherited_class(zend_op *opline, HashTable *class_table, zend_class_entry *parent_ce, zend_bool compile_time TSRMLS_DC)
+ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op *opline, HashTable *class_table, zend_class_entry *parent_ce, zend_bool compile_time TSRMLS_DC)
{
zend_class_entry *ce, **pce;
int found_ce;
@@ -3034,7 +3034,7 @@ void zend_do_early_binding(TSRMLS_D)
MAKE_NOP(opline);
}
-ZEND_API void zend_do_delayed_early_binding(zend_op_array *op_array TSRMLS_DC)
+ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS_DC)
{
if (op_array->early_binding != -1) {
zend_bool orig_in_compilation = CG(in_compilation);
@@ -3073,7 +3073,7 @@ void zend_do_boolean_or_begin(znode *expr1, znode *op_token TSRMLS_DC)
}
-void zend_do_boolean_or_end(znode *result, znode *expr1, znode *expr2, znode *op_token TSRMLS_DC)
+void zend_do_boolean_or_end(znode *result, const znode *expr1, const znode *expr2, znode *op_token TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -3108,7 +3108,7 @@ void zend_do_boolean_and_begin(znode *expr1, znode *op_token TSRMLS_DC)
}
-void zend_do_boolean_and_end(znode *result, znode *expr1, znode *expr2, znode *op_token TSRMLS_DC)
+void zend_do_boolean_and_end(znode *result, const znode *expr1, const znode *expr2, const znode *op_token TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -3129,7 +3129,7 @@ void zend_do_do_while_begin(TSRMLS_D)
}
-void zend_do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr TSRMLS_DC)
+void zend_do_do_while_end(const znode *do_token, const znode *expr_open_bracket, const znode *expr TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -3144,7 +3144,7 @@ void zend_do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr
}
-void zend_do_brk_cont(zend_uchar op, znode *expr TSRMLS_DC)
+void zend_do_brk_cont(zend_uchar op, const znode *expr TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -3162,7 +3162,7 @@ void zend_do_brk_cont(zend_uchar op, znode *expr TSRMLS_DC)
}
-void zend_do_switch_cond(znode *cond TSRMLS_DC)
+void zend_do_switch_cond(const znode *cond TSRMLS_DC)
{
zend_switch_entry switch_entry;
@@ -3178,7 +3178,7 @@ void zend_do_switch_cond(znode *cond TSRMLS_DC)
-void zend_do_switch_end(znode *case_list TSRMLS_DC)
+void zend_do_switch_end(const znode *case_list TSRMLS_DC)
{
zend_op *opline;
zend_switch_entry *switch_entry_ptr;
@@ -3221,7 +3221,7 @@ void zend_do_switch_end(znode *case_list TSRMLS_DC)
}
-void zend_do_case_before_statement(znode *case_list, znode *case_token, znode *case_expr TSRMLS_DC)
+void zend_do_case_before_statement(const znode *case_list, znode *case_token, const znode *case_expr TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
int next_op_number;
@@ -3258,7 +3258,7 @@ void zend_do_case_before_statement(znode *case_list, znode *case_token, znode *c
}
-void zend_do_case_after_statement(znode *result, znode *case_token TSRMLS_DC)
+void zend_do_case_after_statement(znode *result, const znode *case_token TSRMLS_DC)
{
int next_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -3280,7 +3280,7 @@ void zend_do_case_after_statement(znode *result, znode *case_token TSRMLS_DC)
-void zend_do_default_before_statement(znode *case_list, znode *default_token TSRMLS_DC)
+void zend_do_default_before_statement(const znode *case_list, znode *default_token TSRMLS_DC)
{
int next_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -3303,7 +3303,7 @@ void zend_do_default_before_statement(znode *case_list, znode *default_token TSR
}
-void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znode *parent_class_name TSRMLS_DC)
+void zend_do_begin_class_declaration(const znode *class_token, znode *class_name, const znode *parent_class_name TSRMLS_DC)
{
zend_op *opline;
int doing_inheritance = 0;
@@ -3423,7 +3423,7 @@ static void do_verify_abstract_class(TSRMLS_D)
}
-void zend_do_end_class_declaration(znode *class_token, znode *parent_token TSRMLS_DC)
+void zend_do_end_class_declaration(const znode *class_token, const znode *parent_token TSRMLS_DC)
{
zend_class_entry *ce = CG(active_class_entry);
@@ -3494,7 +3494,7 @@ void zend_do_implements_interface(znode *interface_name TSRMLS_DC)
}
-ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, char *src1, int src1_length, char *src2, int src2_length, int internal)
+ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, const char *src1, int src1_length, const char *src2, int src2_length, int internal)
{
char *prop_name;
int prop_name_length;
@@ -3544,7 +3544,7 @@ ZEND_API int zend_unmangle_property_name(char *mangled_property, int len, char *
return SUCCESS;
}
-void zend_do_declare_property(znode *var_name, znode *value, zend_uint access_type TSRMLS_DC)
+void zend_do_declare_property(const znode *var_name, const znode *value, zend_uint access_type TSRMLS_DC)
{
zval *property;
zend_property_info *existing_property_info;
@@ -3590,7 +3590,7 @@ void zend_do_declare_property(znode *var_name, znode *value, zend_uint access_ty
}
-void zend_do_declare_class_constant(znode *var_name, znode *value TSRMLS_DC)
+void zend_do_declare_class_constant(znode *var_name, const znode *value TSRMLS_DC)
{
zval *property;
@@ -3610,7 +3610,7 @@ void zend_do_declare_class_constant(znode *var_name, znode *value TSRMLS_DC)
-void zend_do_fetch_property(znode *result, znode *object, znode *property TSRMLS_DC)
+void zend_do_fetch_property(znode *result, znode *object, const znode *property TSRMLS_DC)
{
zend_op opline;
zend_llist *fetch_list_ptr;
@@ -3713,7 +3713,7 @@ void zend_do_declare_implicit_property(TSRMLS_D)
}
-void zend_do_push_object(znode *object TSRMLS_DC)
+void zend_do_push_object(const znode *object TSRMLS_DC)
{
zend_stack_push(&CG(object_stack), object, sizeof(znode));
}
@@ -3748,7 +3748,7 @@ void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC)
}
-void zend_do_end_new_object(znode *result, znode *new_token, znode *argument_list TSRMLS_DC)
+void zend_do_end_new_object(znode *result, const znode *new_token, const znode *argument_list TSRMLS_DC)
{
znode ctor_result;
@@ -3759,7 +3759,7 @@ void zend_do_end_new_object(znode *result, znode *new_token, znode *argument_lis
*result = CG(active_op_array)->opcodes[new_token->u.opline_num].result;
}
-static zend_constant* zend_get_ct_const(zval *const_name, int mode TSRMLS_DC) /* {{{ */
+static zend_constant* zend_get_ct_const(const zval *const_name, int mode TSRMLS_DC) /* {{{ */
{
zend_constant *c = NULL;
@@ -3919,7 +3919,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con
}
-void zend_do_shell_exec(znode *result, znode *cmd TSRMLS_DC)
+void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -3955,7 +3955,7 @@ void zend_do_shell_exec(znode *result, znode *cmd TSRMLS_DC)
-void zend_do_init_array(znode *result, znode *expr, znode *offset, zend_bool is_ref TSRMLS_DC)
+void zend_do_init_array(znode *result, const znode *expr, const znode *offset, zend_bool is_ref TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -3978,7 +3978,7 @@ void zend_do_init_array(znode *result, znode *expr, znode *offset, zend_bool is_
}
-void zend_do_add_array_element(znode *result, znode *expr, znode *offset, zend_bool is_ref TSRMLS_DC)
+void zend_do_add_array_element(znode *result, const znode *expr, const znode *offset, zend_bool is_ref TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -3995,7 +3995,7 @@ void zend_do_add_array_element(znode *result, znode *expr, znode *offset, zend_b
-void zend_do_add_static_array_element(znode *result, znode *offset, znode *expr)
+void zend_do_add_static_array_element(znode *result, znode *offset, const znode *expr)
{
zval *element;
@@ -4036,7 +4036,7 @@ void zend_do_add_static_array_element(znode *result, znode *offset, znode *expr)
}
-void zend_do_add_list_element(znode *element TSRMLS_DC)
+void zend_do_add_list_element(const znode *element TSRMLS_DC)
{
list_llist_element lle;
@@ -4140,7 +4140,7 @@ void zend_do_list_end(znode *result, znode *expr TSRMLS_DC)
}
}
-void zend_do_fetch_static_variable(znode *varname, znode *static_assignment, int fetch_type TSRMLS_DC)
+void zend_do_fetch_static_variable(znode *varname, const znode *static_assignment, int fetch_type TSRMLS_DC)
{
zval *tmp;
zend_op *opline;
@@ -4214,7 +4214,7 @@ void zend_do_fetch_lexical_variable(znode *varname, zend_bool is_ref TSRMLS_DC)
zend_do_fetch_static_variable(varname, &value, is_ref ? ZEND_FETCH_STATIC : ZEND_FETCH_LEXICAL TSRMLS_CC);
}
-void zend_do_fetch_global_variable(znode *varname, znode *static_assignment, int fetch_type TSRMLS_DC)
+void zend_do_fetch_global_variable(znode *varname, const znode *static_assignment, int fetch_type TSRMLS_DC)
{
zend_op *opline;
znode lval;
@@ -4246,7 +4246,7 @@ void zend_do_fetch_global_variable(znode *varname, znode *static_assignment, int
}
-void zend_do_cast(znode *result, znode *expr, int type TSRMLS_DC)
+void zend_do_cast(znode *result, const znode *expr, int type TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -4260,7 +4260,7 @@ void zend_do_cast(znode *result, znode *expr, int type TSRMLS_DC)
}
-void zend_do_include_or_eval(int type, znode *result, znode *op1 TSRMLS_DC)
+void zend_do_include_or_eval(int type, znode *result, const znode *op1 TSRMLS_DC)
{
zend_do_extended_fcall_begin(TSRMLS_C);
{
@@ -4278,7 +4278,7 @@ void zend_do_include_or_eval(int type, znode *result, znode *op1 TSRMLS_DC)
}
-void zend_do_indirect_references(znode *result, znode *num_references, znode *variable TSRMLS_DC)
+void zend_do_indirect_references(znode *result, const znode *num_references, znode *variable TSRMLS_DC)
{
int i;
@@ -4292,7 +4292,7 @@ void zend_do_indirect_references(znode *result, znode *num_references, znode *va
}
-void zend_do_unset(znode *variable TSRMLS_DC)
+void zend_do_unset(const znode *variable TSRMLS_DC)
{
zend_op *last_op;
@@ -4364,7 +4364,7 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC
}
-void zend_do_instanceof(znode *result, znode *expr, znode *class_znode, int type TSRMLS_DC)
+void zend_do_instanceof(znode *result, const znode *expr, const znode *class_znode, int type TSRMLS_DC)
{
int last_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline;
@@ -4464,7 +4464,7 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
}
-void zend_do_foreach_cont(znode *foreach_token, znode *open_brackets_token, znode *as_token, znode *value, znode *key TSRMLS_DC)
+void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token, const znode *as_token, znode *value, znode *key TSRMLS_DC)
{
zend_op *opline;
znode dummy, value_node;
@@ -4543,7 +4543,7 @@ void zend_do_foreach_cont(znode *foreach_token, znode *open_brackets_token, znod
}
-void zend_do_foreach_end(znode *foreach_token, znode *as_token TSRMLS_DC)
+void zend_do_foreach_end(const znode *foreach_token, const znode *as_token TSRMLS_DC)
{
zend_op *container_ptr;
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -4639,7 +4639,7 @@ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC)
}
-void zend_do_declare_end(znode *declare_token TSRMLS_DC)
+void zend_do_declare_end(const znode *declare_token TSRMLS_DC)
{
zend_declarables *declarables;
@@ -4651,7 +4651,7 @@ void zend_do_declare_end(znode *declare_token TSRMLS_DC)
}
-void zend_do_exit(znode *result, znode *message TSRMLS_DC)
+void zend_do_exit(znode *result, const znode *message TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -4677,7 +4677,7 @@ void zend_do_begin_silence(znode *strudel_token TSRMLS_DC)
}
-void zend_do_end_silence(znode *strudel_token TSRMLS_DC)
+void zend_do_end_silence(const znode *strudel_token TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -4687,7 +4687,7 @@ void zend_do_end_silence(znode *strudel_token TSRMLS_DC)
}
-void zend_do_jmp_set(znode *value, znode *jmp_token, znode *colon_token TSRMLS_DC)
+void zend_do_jmp_set(const znode *value, znode *jmp_token, znode *colon_token TSRMLS_DC)
{
int op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -4706,7 +4706,7 @@ void zend_do_jmp_set(znode *value, znode *jmp_token, znode *colon_token TSRMLS_D
}
-void zend_do_jmp_set_else(znode *result, znode *false_value, znode *jmp_token, znode *colon_token TSRMLS_DC)
+void zend_do_jmp_set_else(znode *result, const znode *false_value, const znode *jmp_token, const znode *colon_token TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -4724,7 +4724,7 @@ void zend_do_jmp_set_else(znode *result, znode *false_value, znode *jmp_token, z
}
-void zend_do_begin_qm_op(znode *cond, znode *qm_token TSRMLS_DC)
+void zend_do_begin_qm_op(const znode *cond, znode *qm_token TSRMLS_DC)
{
int jmpz_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline;
@@ -4741,7 +4741,7 @@ void zend_do_begin_qm_op(znode *cond, znode *qm_token TSRMLS_DC)
}
-void zend_do_qm_true(znode *true_value, znode *qm_token, znode *colon_token TSRMLS_DC)
+void zend_do_qm_true(const znode *true_value, znode *qm_token, znode *colon_token TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -4763,7 +4763,7 @@ void zend_do_qm_true(znode *true_value, znode *qm_token, znode *colon_token TSRM
}
-void zend_do_qm_false(znode *result, znode *false_value, znode *qm_token, znode *colon_token TSRMLS_DC)
+void zend_do_qm_false(znode *result, const znode *false_value, const znode *qm_token, const znode *colon_token TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -4846,7 +4846,7 @@ void zend_auto_global_dtor(zend_auto_global *auto_global)
}
-zend_bool zend_is_auto_global(char *name, uint name_len TSRMLS_DC)
+zend_bool zend_is_auto_global(const char *name, uint name_len TSRMLS_DC)
{
zend_auto_global *auto_global;
@@ -4860,7 +4860,7 @@ zend_bool zend_is_auto_global(char *name, uint name_len TSRMLS_DC)
}
-int zend_register_auto_global(char *name, uint name_len, zend_auto_global_callback auto_global_callback TSRMLS_DC)
+int zend_register_auto_global(const char *name, uint name_len, zend_auto_global_callback auto_global_callback TSRMLS_DC)
{
zend_auto_global auto_global;
@@ -4992,7 +4992,7 @@ int zend_get_class_fetch_type(const char *class_name, uint class_name_len)
}
}
-ZEND_API char* zend_get_compiled_variable_name(zend_op_array *op_array, zend_uint var, int* name_len)
+ZEND_API char* zend_get_compiled_variable_name(const zend_op_array *op_array, zend_uint var, int* name_len)
{
if (name_len) {
*name_len = op_array->vars[var].name_len;
@@ -5028,7 +5028,7 @@ void zend_do_build_namespace_name(znode *result, znode *prefix, znode *name TSRM
}
/* }}} */
-void zend_do_namespace(znode *name TSRMLS_DC) /* {{{ */
+void zend_do_namespace(const znode *name TSRMLS_DC) /* {{{ */
{
char *lcname;
View
166 Zend/zend_compile.h
@@ -353,14 +353,14 @@ ZEND_API int lex_scan(zval *zendlval TSRMLS_DC);
void startup_scanner(TSRMLS_D);
void shutdown_scanner(TSRMLS_D);
-ZEND_API char *zend_set_compiled_filename(char *new_compiled_filename TSRMLS_DC);
+ZEND_API char *zend_set_compiled_filename(const char *new_compiled_filename TSRMLS_DC);
ZEND_API void zend_restore_compiled_filename(char *original_compiled_filename TSRMLS_DC);
ZEND_API char *zend_get_compiled_filename(TSRMLS_D);
ZEND_API int zend_get_compiled_lineno(TSRMLS_D);
ZEND_API size_t zend_get_scanned_file_offset(TSRMLS_D);
void zend_resolve_class_name(znode *class_name, ulong *fetch_type, int check_ns_name TSRMLS_DC);
-ZEND_API char* zend_get_compiled_variable_name(zend_op_array *op_array, zend_uint var, int* name_len);
+ZEND_API char* zend_get_compiled_variable_name(const zend_op_array *op_array, zend_uint var, int* name_len);
#ifdef ZTS
const char *zend_get_zendtext(TSRMLS_D);
@@ -369,66 +369,66 @@ int zend_get_zendleng(TSRMLS_D);
/* parser-driven code generators */
-void zend_do_binary_op(zend_uchar op, znode *result, znode *op1, znode *op2 TSRMLS_DC);
-void zend_do_unary_op(zend_uchar op, znode *result, znode *op1 TSRMLS_DC);
-void zend_do_binary_assign_op(zend_uchar op, znode *result, znode *op1, znode *op2 TSRMLS_DC);
-void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC);
-void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar TSRMLS_DC);
+void zend_do_binary_op(zend_uchar op, znode *result, const znode *op1, const znode *op2 TSRMLS_DC);
+void zend_do_unary_op(zend_uchar op, znode *result, const znode *op1 TSRMLS_DC);
+void zend_do_binary_assign_op(zend_uchar op, znode *result, const znode *op1, const znode *op2 TSRMLS_DC);
+void zend_do_assign(znode *result, znode *variable, const znode *value TSRMLS_DC);
+void zend_do_assign_ref(znode *result, const znode *lvar, const znode *rvar TSRMLS_DC);
void fetch_simple_variable(znode *result, znode *varname, int bp TSRMLS_DC);
void fetch_simple_variable_ex(znode *result, znode *varname, int bp, zend_uchar op TSRMLS_DC);
-void zend_do_indirect_references(znode *result, znode *num_references, znode *variable TSRMLS_DC);
-void zend_do_fetch_static_variable(znode *varname, znode *static_assignment, int fetch_type TSRMLS_DC);
-void zend_do_fetch_global_variable(znode *varname, znode *static_assignment, int fetch_type TSRMLS_DC);
+void zend_do_indirect_references(znode *result, const znode *num_references, znode *variable TSRMLS_DC);
+void zend_do_fetch_static_variable(znode *varname, const znode *static_assignment, int fetch_type TSRMLS_DC);
+void zend_do_fetch_global_variable(znode *varname, const znode *static_assignment, int fetch_type TSRMLS_DC);
void fetch_array_begin(znode *result, znode *varname, znode *first_dim TSRMLS_DC);
-void fetch_array_dim(znode *result, znode *parent, znode *dim TSRMLS_DC);
-void fetch_string_offset(znode *result, znode *parent, znode *offset TSRMLS_DC);
+void fetch_array_dim(znode *result, const znode *parent, const znode *dim TSRMLS_DC);
+void fetch_string_offset(znode *result, const znode *parent, const znode *offset TSRMLS_DC);
void zend_do_fetch_static_member(znode *result, znode *class_znode TSRMLS_DC);
-void zend_do_print(znode *result, znode *arg TSRMLS_DC);
-void zend_do_echo(znode *arg TSRMLS_DC);
+void zend_do_print(znode *result, const znode *arg TSRMLS_DC);
+void zend_do_echo(const znode *arg TSRMLS_DC);
typedef int (*unary_op_type)(zval *, zval *);
ZEND_API unary_op_type get_unary_op(int opcode);
ZEND_API void *get_binary_op(int opcode);
-void zend_do_while_cond(znode *expr, znode *close_bracket_token TSRMLS_DC);
-void zend_do_while_end(znode *while_token, znode *close_bracket_token TSRMLS_DC);
+void zend_do_while_cond(const znode *expr, znode *close_bracket_token TSRMLS_DC);
+void zend_do_while_end(const znode *while_token, const znode *close_bracket_token TSRMLS_DC);
void zend_do_do_while_begin(TSRMLS_D);
-void zend_do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr TSRMLS_DC);
+void zend_do_do_while_end(const znode *do_token, const znode *expr_open_bracket, const znode *expr TSRMLS_DC);
-void zend_do_if_cond(znode *cond, znode *closing_bracket_token TSRMLS_DC);
-void zend_do_if_after_statement(znode *closing_bracket_token, unsigned char initialize TSRMLS_DC);
+void zend_do_if_cond(const znode *cond, znode *closing_bracket_token TSRMLS_DC);
+void zend_do_if_after_statement(const znode *closing_bracket_token, unsigned char initialize TSRMLS_DC);
void zend_do_if_end(TSRMLS_D);
-void zend_do_for_cond(znode *expr, znode *second_semicolon_token TSRMLS_DC);
-void zend_do_for_before_statement(znode *cond_start, znode *second_semicolon_token TSRMLS_DC);
-void zend_do_for_end(znode *second_semicolon_token TSRMLS_DC);
+void zend_do_for_cond(const znode *expr, znode *second_semicolon_token TSRMLS_DC);
+void zend_do_for_before_statement(const znode *cond_start, const znode *second_semicolon_token TSRMLS_DC);
+void zend_do_for_end(const znode *second_semicolon_token TSRMLS_DC);
-void zend_do_pre_incdec(znode *result, znode *op1, zend_uchar op TSRMLS_DC);
-void zend_do_post_incdec(znode *result, znode *op1, zend_uchar op TSRMLS_DC);
+void zend_do_pre_incdec(znode *result, const znode *op1, zend_uchar op TSRMLS_DC);
+void zend_do_post_incdec(znode *result, const znode *op1, zend_uchar op TSRMLS_DC);
void zend_do_begin_variable_parse(TSRMLS_D);
void zend_do_end_variable_parse(znode *variable, int type, int arg_offset TSRMLS_DC);
-void zend_check_writable_variable(znode *variable);
+void zend_check_writable_variable(const znode *variable);
void zend_do_free(znode *op1 TSRMLS_DC);
-void zend_do_add_string(znode *result, znode *op1, znode *op2 TSRMLS_DC);
-void zend_do_add_variable(znode *result, znode *op1, znode *op2 TSRMLS_DC);
+void zend_do_add_string(znode *result, const znode *op1, znode *op2 TSRMLS_DC);
+void zend_do_add_variable(znode *result, const znode *op1, const znode *op2 TSRMLS_DC);
-int zend_do_verify_access_types(znode *current_access_type, znode *new_modifier);
+int zend_do_verify_access_types(const znode *current_access_type, const znode *new_modifier);
void zend_do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference, znode *fn_flags_znode TSRMLS_DC);
-void zend_do_end_function_declaration(znode *function_token TSRMLS_DC);
-void zend_do_receive_arg(zend_uchar op, znode *var, znode *offset, znode *initialization, znode *class_type, znode *varname, zend_bool pass_by_reference TSRMLS_DC);
+void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC);
+void zend_do_receive_arg(zend_uchar op, const znode *var, const znode *offset, const znode *initialization, znode *class_type, const znode *varname, zend_bool pass_by_reference TSRMLS_DC);
int zend_do_begin_function_call(znode *function_name, zend_bool check_namespace TSRMLS_DC);
void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC);
-void zend_do_clone(znode *result, znode *expr TSRMLS_DC);
+void zend_do_clone(znode *result, const znode *expr TSRMLS_DC);
void zend_do_begin_dynamic_function_call(znode *function_name, int prefix_len TSRMLS_DC);
void zend_do_fetch_class(znode *result, znode *class_name TSRMLS_DC);
void zend_do_build_full_name(znode *result, znode *prefix, znode *name TSRMLS_DC);
int zend_do_begin_class_member_function_call(znode *class_name, znode *method_name TSRMLS_DC);
-void zend_do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC);
+void zend_do_end_function_call(znode *function_name, znode *result, const znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC);
void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC);
void zend_do_handle_exception(TSRMLS_D);
@@ -436,94 +436,94 @@ void zend_do_begin_lambda_function_declaration(znode *result, znode *function_to
void zend_do_fetch_lexical_variable(znode *varname, zend_bool is_ref TSRMLS_DC);
void zend_do_try(znode *try_token TSRMLS_DC);
-void zend_do_begin_catch(znode *try_token, znode *catch_class, znode *catch_var, znode *first_catch TSRMLS_DC);
-void zend_do_end_catch(znode *try_token TSRMLS_DC);
-void zend_do_throw(znode *expr TSRMLS_DC);
+void zend_do_begin_catch(znode *try_token, znode *catch_class, const znode *catch_var, znode *first_catch TSRMLS_DC);
+void zend_do_end_catch(const znode *try_token TSRMLS_DC);
+void zend_do_throw(const znode *expr TSRMLS_DC);
ZEND_API int do_bind_function(zend_op *opline, HashTable *function_table, zend_bool compile_time);
-ZEND_API zend_class_entry *do_bind_class(zend_op *opline, HashTable *class_table, zend_bool compile_time TSRMLS_DC);
-ZEND_API zend_class_entry *do_bind_inherited_class(zend_op *opline, HashTable *class_table, zend_class_entry *parent_ce, zend_bool compile_time TSRMLS_DC);
-ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC);
+ZEND_API zend_class_entry *do_bind_class(const zend_op *opline, HashTable *class_table, zend_bool compile_time TSRMLS_DC);
+ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op *opline, HashTable *class_table, zend_class_entry *parent_ce, zend_bool compile_time TSRMLS_DC);
+ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_entry *iface TSRMLS_DC);
ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC);
void zend_do_implements_interface(znode *interface_znode TSRMLS_DC);
ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC);
void zend_do_early_binding(TSRMLS_D);
-ZEND_API void zend_do_delayed_early_binding(zend_op_array *op_array TSRMLS_DC);
+ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS_DC);
void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC);
void zend_do_boolean_or_begin(znode *expr1, znode *op_token TSRMLS_DC);
-void zend_do_boolean_or_end(znode *result, znode *expr1, znode *expr2, znode *op_token TSRMLS_DC);
+void zend_do_boolean_or_end(znode *result, const znode *expr1, const znode *expr2, znode *op_token TSRMLS_DC);
void zend_do_boolean_and_begin(znode *expr1, znode *op_token TSRMLS_DC);
-void zend_do_boolean_and_end(znode *result, znode *expr1, znode *expr2, znode *op_token TSRMLS_DC);
+void zend_do_boolean_and_end(znode *result, const znode *expr1, const znode *expr2, const znode *op_token TSRMLS_DC);
-void zend_do_brk_cont(zend_uchar op, znode *expr TSRMLS_DC);
+void zend_do_brk_cont(zend_uchar op, const znode *expr TSRMLS_DC);
-void zend_do_switch_cond(znode *cond TSRMLS_DC);
-void zend_do_switch_end(znode *case_list TSRMLS_DC);
-void zend_do_case_before_statement(znode *case_list, znode *case_token, znode *case_expr TSRMLS_DC);
-void zend_do_case_after_statement(znode *result, znode *case_token TSRMLS_DC);
-void zend_do_default_before_statement(znode *case_list, znode *default_token TSRMLS_DC);
+void zend_do_switch_cond(const znode *cond TSRMLS_DC);
+void zend_do_switch_end(const znode *case_list TSRMLS_DC);
+void zend_do_case_before_statement(const znode *case_list, znode *case_token, const znode *case_expr TSRMLS_DC);
+void zend_do_case_after_statement(znode *result, const znode *case_token TSRMLS_DC);
+void zend_do_default_before_statement(const znode *case_list, znode *default_token TSRMLS_DC);
-void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znode *parent_class_name TSRMLS_DC);
-void zend_do_end_class_declaration(znode *class_token, znode *parent_token TSRMLS_DC);
-void zend_do_declare_property(znode *var_name, znode *value, zend_uint access_type TSRMLS_DC);
+void zend_do_begin_class_declaration(const znode *class_token, znode *class_name, const znode *parent_class_name TSRMLS_DC);
+void zend_do_end_class_declaration(const znode *class_token, const znode *parent_token TSRMLS_DC);
+void zend_do_declare_property(const znode *var_name, const znode *value, zend_uint access_type TSRMLS_DC);
void zend_do_declare_implicit_property(TSRMLS_D);
-void zend_do_declare_class_constant(znode *var_name, znode *value TSRMLS_DC);
+void zend_do_declare_class_constant(znode *var_name, const znode *value TSRMLS_DC);
-void zend_do_fetch_property(znode *result, znode *object, znode *property TSRMLS_DC);
+void zend_do_fetch_property(znode *result, znode *object, const znode *property TSRMLS_DC);
void zend_do_halt_compiler_register(TSRMLS_D);
-void zend_do_push_object(znode *object TSRMLS_DC);
+void zend_do_push_object(const znode *object TSRMLS_DC);
void zend_do_pop_object(znode *object TSRMLS_DC);
void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC);
-void zend_do_end_new_object(znode *result, znode *new_token, znode *argument_list TSRMLS_DC);
+void zend_do_end_new_object(znode *result, const znode *new_token, const znode *argument_list TSRMLS_DC);
void zend_do_fetch_constant(znode *result, znode *constant_container, znode *constant_name, int mode, zend_bool check_namespace TSRMLS_DC);
-void zend_do_shell_exec(znode *result, znode *cmd TSRMLS_DC);
+void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC);
-void zend_do_init_array(znode *result, znode *expr, znode *offset, zend_bool is_ref TSRMLS_DC);
-void zend_do_add_array_element(znode *result, znode *expr, znode *offset, zend_bool is_ref TSRMLS_DC);
-void zend_do_add_static_array_element(znode *result, znode *offset, znode *expr);
+void zend_do_init_array(znode *result, const znode *expr, const znode *offset, zend_bool is_ref TSRMLS_DC);
+void zend_do_add_array_element(znode *result, const znode *expr, const znode *offset, zend_bool is_ref TSRMLS_DC);
+void zend_do_add_static_array_element(znode *result, znode *offset, const znode *expr);
void zend_do_list_init(TSRMLS_D);
void zend_do_list_end(znode *result, znode *expr TSRMLS_DC);
-void zend_do_add_list_element(znode *element TSRMLS_DC);
+void zend_do_add_list_element(const znode *element TSRMLS_DC);
void zend_do_new_list_begin(TSRMLS_D);
void zend_do_new_list_end(TSRMLS_D);
-void zend_do_cast(znode *result, znode *expr, int type TSRMLS_DC);
-void zend_do_include_or_eval(int type, znode *result, znode *op1 TSRMLS_DC);
+void zend_do_cast(znode *result, const znode *expr, int type TSRMLS_DC);
+void zend_do_include_or_eval(int type, znode *result, const znode *op1 TSRMLS_DC);
-void zend_do_unset(znode *variable TSRMLS_DC);
+void zend_do_unset(const znode *variable TSRMLS_DC);
void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC);
-void zend_do_instanceof(znode *result, znode *expr, znode *class_znode, int type TSRMLS_DC);
+void zend_do_instanceof(znode *result, const znode *expr, const znode *class_znode, int type TSRMLS_DC);
void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, znode *array, znode *as_token, int variable TSRMLS_DC);
-void zend_do_foreach_cont(znode *foreach_token, znode *open_brackets_token, znode *as_token, znode *value, znode *key TSRMLS_DC);
-void zend_do_foreach_end(znode *foreach_token, znode *as_token TSRMLS_DC);
+void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token, const znode *as_token, znode *value, znode *key TSRMLS_DC);
+void zend_do_foreach_end(const znode *foreach_token, const znode *as_token TSRMLS_DC);
void zend_do_declare_begin(TSRMLS_D);
void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC);
-void zend_do_declare_end(znode *declare_token TSRMLS_DC);
+void zend_do_declare_end(const znode *declare_token TSRMLS_DC);
-void zend_do_exit(znode *result, znode *message TSRMLS_DC);
+void zend_do_exit(znode *result, const znode *message TSRMLS_DC);
void zend_do_begin_silence(znode *strudel_token TSRMLS_DC);
-void zend_do_end_silence(znode *strudel_token TSRMLS_DC);
+void zend_do_end_silence(const znode *strudel_token TSRMLS_DC);
-void zend_do_jmp_set(znode *value, znode *jmp_token, znode *colon_token TSRMLS_DC);
-void zend_do_jmp_set_else(znode *result, znode *false_value, znode *jmp_token, znode *colon_token TSRMLS_DC);
+void zend_do_jmp_set(const znode *value, znode *jmp_token, znode *colon_token TSRMLS_DC);
+void zend_do_jmp_set_else(znode *result, const znode *false_value, const znode *jmp_token, const znode *colon_token TSRMLS_DC);
-void zend_do_begin_qm_op(znode *cond, znode *qm_token TSRMLS_DC);
-void zend_do_qm_true(znode *true_value, znode *qm_token, znode *colon_token TSRMLS_DC);
-void zend_do_qm_false(znode *result, znode *false_value, znode *qm_token, znode *colon_token TSRMLS_DC);
+void zend_do_begin_qm_op(const znode *cond, znode *qm_token TSRMLS_DC);
+void zend_do_qm_true(const znode *true_value, znode *qm_token, znode *colon_token TSRMLS_DC);
+void zend_do_qm_false(znode *result, const znode *false_value, const znode *qm_token, const znode *colon_token TSRMLS_DC);
void zend_do_extended_info(TSRMLS_D);
void zend_do_extended_fcall_begin(TSRMLS_D);
@@ -531,16 +531,16 @@ void zend_do_extended_fcall_end(TSRMLS_D);
void zend_do_ticks(TSRMLS_D);
-void zend_do_abstract_method(znode *function_name, znode *modifiers, znode *body TSRMLS_DC);
+void zend_do_abstract_method(const znode *function_name, znode *modifiers, const znode *body TSRMLS_DC);
void zend_do_declare_constant(znode *name, znode *value TSRMLS_DC);
void zend_do_build_namespace_name(znode *result, znode *prefix, znode *name TSRMLS_DC);
-void zend_do_namespace(znode *name TSRMLS_DC);
+void zend_do_namespace(const znode *name TSRMLS_DC);
void zend_do_use(znode *name, znode *new_name, int is_global TSRMLS_DC);
void zend_do_end_compilation(TSRMLS_D);
void zend_do_label(znode *label TSRMLS_DC);
-void zend_do_goto(znode *label TSRMLS_DC);
+void zend_do_goto(const znode *label TSRMLS_DC);
void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2 TSRMLS_DC);
void zend_release_labels(TSRMLS_D);
@@ -567,7 +567,7 @@ ZEND_API void zend_function_dtor(zend_function *function);
ZEND_API void destroy_zend_class(zend_class_entry **pce);
void zend_class_add_ref(zend_class_entry **ce);
-ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, char *src1, int src1_length, char *src2, int src2_length, int internal);
+ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, const char *src1, int src1_length, const char *src2, int src2_length, int internal);
ZEND_API int zend_unmangle_property_name(char *mangled_property, int mangled_property_len, char **prop_name, char **class_name);
#define ZEND_FUNCTION_DTOR (void (*)(void *)) zend_function_dtor
@@ -581,10 +581,10 @@ void print_op_array(zend_op_array *op_array, int optimizations);
int pass_two(zend_op_array *op_array TSRMLS_DC);
zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array);
void zend_do_first_catch(znode *open_parentheses TSRMLS_DC);
-void zend_initialize_try_catch_element(znode *try_token TSRMLS_DC);
-void zend_do_mark_last_catch(znode *first_catch, znode *last_additional_catch TSRMLS_DC);
+void zend_initialize_try_catch_element(const znode *try_token TSRMLS_DC);
+void zend_do_mark_last_catch(const znode *first_catch, const znode *last_additional_catch TSRMLS_DC);
ZEND_API zend_bool zend_is_compiling(TSRMLS_D);
-ZEND_API char *zend_make_compiled_string_description(char *name TSRMLS_DC);
+ZEND_API char *zend_make_compiled_string_description(const char *name TSRMLS_DC);
ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers TSRMLS_DC);
int zend_get_class_fetch_type(const char *class_name, uint class_name_len);
@@ -597,9 +597,9 @@ typedef struct _zend_auto_global {
} zend_auto_global;
void zend_auto_global_dtor(zend_auto_global *auto_global);
-ZEND_API int zend_register_auto_global(char *name, uint name_len, zend_auto_global_callback auto_global_callback TSRMLS_DC);
-ZEND_API zend_bool zend_is_auto_global(char *name, uint name_len TSRMLS_DC);
-ZEND_API int zend_auto_global_disable_jit(char *varname, zend_uint varname_length TSRMLS_DC);
+ZEND_API int zend_register_auto_global(const char *name, uint name_len, zend_auto_global_callback auto_global_callback TSRMLS_DC);
+ZEND_API zend_bool zend_is_auto_global(const char *name, uint name_len TSRMLS_DC);
+ZEND_API int zend_auto_global_disable_jit(const char *varname, zend_uint varname_length TSRMLS_DC);
ZEND_API size_t zend_dirname(char *path, size_t len);
int zendlex(znode *zendlval TSRMLS_DC);
View
18 Zend/zend_constants.c
@@ -53,19 +53,19 @@ void zend_copy_constants(HashTable *target, HashTable *source)
}
-static int clean_non_persistent_constant(zend_constant *c TSRMLS_DC)
+static int clean_non_persistent_constant(const zend_constant *c TSRMLS_DC)
{
return (c->flags & CONST_PERSISTENT) ? ZEND_HASH_APPLY_STOP : ZEND_HASH_APPLY_REMOVE;
}
-static int clean_non_persistent_constant_full(zend_constant *c TSRMLS_DC)
+static int clean_non_persistent_constant_full(const zend_constant *c TSRMLS_DC)
{
return (c->flags & CONST_PERSISTENT) ? 0 : 1;
}
-static int clean_module_constant(zend_constant *c, int *module_number TSRMLS_DC)
+static int clean_module_constant(const zend_constant *c, int *module_number TSRMLS_DC)
{
if (c->module_number == *module_number) {
return 1;
@@ -172,7 +172,7 @@ void clean_non_persistent_constants(TSRMLS_D)
}
-ZEND_API void zend_register_long_constant(char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC)
+ZEND_API void zend_register_long_constant(const char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC)
{
zend_constant c;
@@ -186,7 +186,7 @@ ZEND_API void zend_register_long_constant(char *name, uint name_len, long lval,
}
-ZEND_API void zend_register_double_constant(char *name, uint name_len, double dval, int flags, int module_number TSRMLS_DC)
+ZEND_API void zend_register_double_constant(const char *name, uint name_len, double dval, int flags, int module_number TSRMLS_DC)
{
zend_constant c;
@@ -200,7 +200,7 @@ ZEND_API void zend_register_double_constant(char *name, uint name_len, double dv
}
-ZEND_API void zend_register_stringl_constant(char *name, uint name_len, char *strval, uint strlen, int flags, int module_number TSRMLS_DC)
+ZEND_API void zend_register_stringl_constant(const char *name, uint name_len, char *strval, uint strlen, int flags, int module_number TSRMLS_DC)
{
zend_constant c;
@@ -215,13 +215,13 @@ ZEND_API void zend_register_stringl_constant(char *name, uint name_len, char *st
}
-ZEND_API void zend_register_string_constant(char *name, uint name_len, char *strval, int flags, int module_number TSRMLS_DC)
+ZEND_API void zend_register_string_constant(const char *name, uint name_len, char *strval, int flags, int module_number TSRMLS_DC)
{
zend_register_stringl_constant(name, name_len, strval, strlen(strval), flags, module_number TSRMLS_CC);
}
-ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC)
+ZEND_API int zend_get_constant(const char *name, uint name_len, zval *result TSRMLS_DC)
{
zend_constant *c;
int retval = 1;
@@ -272,7 +272,7 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC
return retval;
}
-ZEND_API int zend_get_constant_ex(char *name, uint name_len, zval *result, zend_class_entry *scope, ulong flags TSRMLS_DC)
+ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result, zend_class_entry *scope, ulong flags TSRMLS_DC)
{
zend_constant *c;
int retval = 1;
View
12 Zend/zend_constants.h
@@ -60,12 +60,12 @@ int zend_startup_constants(TSRMLS_D);
int zend_shutdown_constants(TSRMLS_D);
void zend_register_standard_constants(TSRMLS_D);
void clean_non_persistent_constants(TSRMLS_D);
-ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC);
-ZEND_API int zend_get_constant_ex(char *name, uint name_len, zval *result, zend_class_entry *scope, ulong flags TSRMLS_DC);
-ZEND_API void zend_register_long_constant(char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC);
-ZEND_API void zend_register_double_constant(char *name, uint name_len, double dval, int flags, int module_number TSRMLS_DC);
-ZEND_API void zend_register_string_constant(char *name, uint name_len, char *strval, int flags, int module_number TSRMLS_DC);
-ZEND_API void zend_register_stringl_constant(char *name, uint name_len, char *strval, uint strlen, int flags, int module_number TSRMLS_DC);
+ZEND_API int zend_get_constant(const char *name, uint name_len, zval *result TSRMLS_DC);
+ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result, zend_class_entry *scope, ulong flags TSRMLS_DC);
+ZEND_API void zend_register_long_constant(const char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC);
+ZEND_API void zend_register_double_constant(const char *name, uint name_len, double dval, int flags, int module_number TSRMLS_DC);
+ZEND_API void zend_register_string_constant(const char *name, uint name_len, char *strval, int flags, int module_number TSRMLS_DC);
+ZEND_API void zend_register_stringl_constant(const char *name, uint name_len, char *strval, uint strlen, int flags, int module_number TSRMLS_DC);
ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC);
void zend_copy_constants(HashTable *target, HashTable *sourc);
void copy_zend_constant(zend_constant *c);
View
48 Zend/zend_execute.c
@@ -54,9 +54,9 @@ typedef int (*incdec_t)(zval *);
#define get_obj_zval_ptr_ptr(node, Ts, should_free, type) _get_obj_zval_ptr_ptr(node, Ts, should_free, type TSRMLS_CC)
/* Prototypes */
-static void zend_extension_statement_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
-static void zend_extension_fcall_begin_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
-static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
+static void zend_extension_statement_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
+static void zend_extension_fcall_begin_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
+static void zend_extension_fcall_end_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
#define RETURN_VALUE_USED(opline) (!((opline)->result.u.EA.type & EXT_TYPE_UNUSED))
@@ -169,17 +169,17 @@ static inline void zend_pzval_unlock_free_func(zval *z)
#define DECODE_CTOR(ce) \
((zend_class_entry*)(((zend_uintptr_t)(ce)) & ~(CTOR_CALL_BIT|CTOR_USED_BIT)))
-ZEND_API zval** zend_get_compiled_variable_value(zend_execute_data *execute_data_ptr, zend_uint var)
+ZEND_API zval** zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, zend_uint var)
{
return execute_data_ptr->CVs[var];
}
-static inline zval *_get_zval_ptr_tmp(znode *node, temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
+static inline zval *_get_zval_ptr_tmp(const znode *node, const temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
{
return should_free->var = &T(node->u.var).tmp_var;
}
-static inline zval *_get_zval_ptr_var(znode *node, temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
+static inline zval *_get_zval_ptr_var(const znode *node, const temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
{
zval *ptr = T(node->u.var).var.ptr;
if (ptr) {
@@ -211,7 +211,7 @@ static inline zval *_get_zval_ptr_var(znode *node, temp_variable *Ts, zend_free_
}
}
-static inline zval *_get_zval_ptr_cv(znode *node, temp_variable *Ts, int type TSRMLS_DC)
+static inline zval *_get_zval_ptr_cv(const znode *node, const temp_variable *Ts, int type TSRMLS_DC)
{
zval ***ptr = &CV_OF(node->u.var);
@@ -245,7 +245,7 @@ static inline zval *_get_zval_ptr_cv(znode *node, temp_variable *Ts, int type TS
return **ptr;
}
-static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
+static inline zval *_get_zval_ptr(znode *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
{
/* should_free->is_var = 0; */
switch (node->op_type) {
@@ -273,7 +273,7 @@ static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, zend_free_op *
return NULL;
}
-static inline zval **_get_zval_ptr_ptr_var(znode *node, temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
+static inline zval **_get_zval_ptr_ptr_var(const znode *node, const temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
{
zval** ptr_ptr = T(node->u.var).var.ptr_ptr;
@@ -286,7 +286,7 @@ static inline zval **_get_zval_ptr_ptr_var(znode *node, temp_variable *Ts, zend_
return ptr_ptr;
}
-static inline zval **_get_zval_ptr_ptr_cv(znode *node, temp_variable *Ts, int type TSRMLS_DC)
+static inline zval **_get_zval_ptr_ptr_cv(const znode *node, const temp_variable *Ts, int type TSRMLS_DC)
{
zval ***ptr = &CV_OF(node->u.var);
@@ -321,7 +321,7 @@ static inline zval **_get_zval_ptr_ptr_cv(znode *node, temp_variable *Ts, int ty
return *ptr;
}
-static inline zval **_get_zval_ptr_ptr(znode *node, temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
+static inline zval **_get_zval_ptr_ptr(const znode *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
{
if (node->op_type == IS_CV) {
should_free->var = 0;
@@ -344,7 +344,7 @@ static inline zval *_get_obj_zval_ptr_unused(TSRMLS_D)
}
}
-static inline zval **_get_obj_zval_ptr_ptr(znode *op, temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
+static inline zval **_get_obj_zval_ptr_ptr(const znode *op, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
{
if (op->op_type == IS_UNUSED) {
if (EXPECTED(EG(This) != NULL)) {
@@ -369,7 +369,7 @@ static inline zval **_get_obj_zval_ptr_ptr_unused(TSRMLS_D)
}
}
-static inline zval *_get_obj_zval_ptr(znode *op, temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
+static inline zval *_get_obj_zval_ptr(znode *op, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
{
if (op->op_type == IS_UNUSED) {
if (EXPECTED(EG(This) != NULL)) {
@@ -466,7 +466,7 @@ static inline char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_inf
}
}
-static inline int zend_verify_arg_error(zend_function *zf, zend_uint arg_num, const zend_arg_info *cur_arg_info, const char *need_msg, const char *need_kind, char *given_msg, char *given_kind TSRMLS_DC)
+static inline int zend_verify_arg_error(const zend_function *zf, zend_uint arg_num, const zend_arg_info *cur_arg_info, const char *need_msg, const char *need_kind, const char *given_msg, char *given_kind TSRMLS_DC)
{
zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
char *fname = zf->common.function_name;
@@ -529,8 +529,8 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
return 1;
}
+static inline void zend_assign_to_object(znode *result, zval **object_ptr, zval *property_name, znode *value_op, const temp_variable *Ts, int opcode TSRMLS_DC)
-static inline void zend_assign_to_object(znode *result, zval **object_ptr, zval *property_name, znode *value_op, temp_variable *Ts, int opcode TSRMLS_DC)
{
zval *object;
zend_free_op free_value;
@@ -619,7 +619,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, zval
FREE_OP_IF_VAR(free_value);
}
-static inline int zend_assign_to_string_offset(temp_variable *T, zval *value, int value_type TSRMLS_DC)
+static inline int zend_assign_to_string_offset(const temp_variable *T, const zval *value, int value_type TSRMLS_DC)
{
if (Z_TYPE_P(T->str_offset.str) == IS_STRING) {
@@ -749,7 +749,7 @@ static inline zval* zend_assign_to_variable(zval **variable_ptr_ptr, zval *value
/* Utility Functions for Extensions */
-static void zend_extension_statement_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
+static void zend_extension_statement_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
{