Skip to content

Commit 6783824

Browse files
authored
Zend: mark callable zval* as const (php#21582)
1 parent d4ef996 commit 6783824

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

Zend/zend_API.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4031,7 +4031,7 @@ static zend_always_inline bool zend_is_callable_check_func(const zval *callable,
40314031
}
40324032
/* }}} */
40334033

4034-
ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, const zend_object *object) /* {{{ */
4034+
ZEND_API zend_string *zend_get_callable_name_ex(const zval *callable, const zend_object *object) /* {{{ */
40354035
{
40364036
try_again:
40374037
switch (Z_TYPE_P(callable)) {
@@ -4089,7 +4089,7 @@ ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, const zend_objec
40894089
}
40904090
/* }}} */
40914091

4092-
ZEND_API zend_string *zend_get_callable_name(zval *callable) /* {{{ */
4092+
ZEND_API zend_string *zend_get_callable_name(const zval *callable) /* {{{ */
40934093
{
40944094
return zend_get_callable_name_ex(callable, NULL);
40954095
}
@@ -4206,7 +4206,7 @@ ZEND_API bool zend_is_callable_at_frame(
42064206
}
42074207
/* }}} */
42084208

4209-
ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error) /* {{{ */
4209+
ZEND_API bool zend_is_callable_ex(const zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error) /* {{{ */
42104210
{
42114211
/* Determine callability at the first parent user frame. */
42124212
const zend_execute_data *frame = EG(current_execute_data);
@@ -4221,13 +4221,13 @@ ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t
42214221
return ret;
42224222
}
42234223

4224-
ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name) /* {{{ */
4224+
ZEND_API bool zend_is_callable(const zval *callable, uint32_t check_flags, zend_string **callable_name) /* {{{ */
42254225
{
42264226
return zend_is_callable_ex(callable, NULL, check_flags, callable_name, NULL, NULL);
42274227
}
42284228
/* }}} */
42294229

4230-
ZEND_API zend_result zend_fcall_info_init(zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error) /* {{{ */
4230+
ZEND_API zend_result zend_fcall_info_init(const zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error) /* {{{ */
42314231
{
42324232
if (!zend_is_callable_ex(callable, NULL, check_flags, callable_name, fcc, error)) {
42334233
return FAILURE;

Zend/zend_API.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,13 @@ ZEND_API ZEND_COLD void zend_wrong_property_read(const zval *object, zval *prope
410410
#define IS_CALLABLE_SUPPRESS_DEPRECATIONS (1<<1)
411411

412412
ZEND_API void zend_release_fcall_info_cache(zend_fcall_info_cache *fcc);
413-
ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, const zend_object *object);
414-
ZEND_API zend_string *zend_get_callable_name(zval *callable);
413+
ZEND_API zend_string *zend_get_callable_name_ex(const zval *callable, const zend_object *object);
414+
ZEND_API zend_string *zend_get_callable_name(const zval *callable);
415415
ZEND_API bool zend_is_callable_at_frame(
416416
const zval *callable, zend_object *object, const zend_execute_data *frame,
417417
uint32_t check_flags, zend_fcall_info_cache *fcc, char **error);
418-
ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error);
419-
ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name);
418+
ZEND_API bool zend_is_callable_ex(const zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error);
419+
ZEND_API bool zend_is_callable(const zval *callable, uint32_t check_flags, zend_string **callable_name);
420420
ZEND_API const char *zend_get_module_version(const char *module_name);
421421
ZEND_API zend_result zend_get_module_started(const char *module_name);
422422

@@ -701,7 +701,7 @@ ZEND_API zend_result _call_user_function_impl(zval *object, zval *function_name,
701701
* fci->params = NULL;
702702
* The callable_name argument may be NULL.
703703
*/
704-
ZEND_API zend_result zend_fcall_info_init(zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error);
704+
ZEND_API zend_result zend_fcall_info_init(const zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error);
705705

706706
/** Clear arguments connected with zend_fcall_info *fci
707707
* If free_mem is not zero then the params array gets free'd as well
@@ -2482,7 +2482,7 @@ static zend_always_inline bool zend_parse_arg_resource(zval *arg, zval **dest, b
24822482
return 1;
24832483
}
24842484

2485-
static zend_always_inline bool zend_parse_arg_func(zval *arg, zend_fcall_info *dest_fci, zend_fcall_info_cache *dest_fcc, bool check_null, char **error, bool free_trampoline)
2485+
static zend_always_inline bool zend_parse_arg_func(const zval *arg, zend_fcall_info *dest_fci, zend_fcall_info_cache *dest_fcc, bool check_null, char **error, bool free_trampoline)
24862486
{
24872487
if (check_null && UNEXPECTED(Z_TYPE_P(arg) == IS_NULL)) {
24882488
dest_fci->size = 0;

0 commit comments

Comments
 (0)