@@ -497,6 +497,12 @@ typedef struct _zend_class_constant {
497497
498498#define ZEND_CLASS_CONST_FLAGS (c ) Z_CONSTANT_FLAGS((c)->value)
499499
500+ C23_ENUM (zend_function_type , uint8_t ) {
501+ ZEND_INTERNAL_FUNCTION = 1 ,
502+ ZEND_USER_FUNCTION = 2 ,
503+ ZEND_EVAL_CODE = 4 ,
504+ };
505+
500506/* arg_info for internal functions */
501507typedef struct _zend_internal_arg_info {
502508 const char * name ;
@@ -524,7 +530,7 @@ typedef struct _zend_internal_function_info {
524530
525531struct _zend_op_array {
526532 /* Common elements */
527- uint8_t type ;
533+ zend_function_type type ;
528534 uint8_t arg_flags [3 ]; /* bitset of arg_info.pass_by_reference */
529535 uint32_t fn_flags ;
530536 zend_string * function_name ;
@@ -584,7 +590,7 @@ typedef void (ZEND_FASTCALL *zif_handler)(INTERNAL_FUNCTION_PARAMETERS);
584590
585591typedef struct _zend_internal_function {
586592 /* Common elements */
587- uint8_t type ;
593+ zend_function_type type ;
588594 uint8_t arg_flags [3 ]; /* bitset of arg_info.pass_by_reference */
589595 uint32_t fn_flags ;
590596 zend_string * function_name ;
@@ -610,11 +616,11 @@ typedef struct _zend_internal_function {
610616#define ZEND_FN_SCOPE_NAME (function ) ((function) && (function)->common.scope ? ZSTR_VAL((function)->common.scope->name) : "")
611617
612618union _zend_function {
613- uint8_t type ; /* MUST be the first element of this struct! */
619+ zend_function_type type ; /* MUST be the first element of this struct! */
614620 uint32_t quick_arg_flags ;
615621
616622 struct {
617- uint8_t type ; /* never used */
623+ zend_function_type type ; /* never used */
618624 uint8_t arg_flags [3 ]; /* bitset of arg_info.pass_by_reference */
619625 uint32_t fn_flags ;
620626 zend_string * function_name ;
@@ -956,7 +962,7 @@ ZEND_API zend_ast *zend_compile_string_to_ast(
956962ZEND_API zend_result zend_execute_scripts (int type , zval * retval , int file_count , ...);
957963ZEND_API zend_result zend_execute_script (int type , zval * retval , zend_file_handle * file_handle );
958964ZEND_API zend_result open_file_for_scanning (zend_file_handle * file_handle );
959- ZEND_API void init_op_array (zend_op_array * op_array , uint8_t type , int initial_ops_size );
965+ ZEND_API void init_op_array (zend_op_array * op_array , zend_function_type type , int initial_ops_size );
960966ZEND_API void destroy_op_array (zend_op_array * op_array );
961967ZEND_API void zend_destroy_static_vars (zend_op_array * op_array );
962968ZEND_API void zend_destroy_file_handle (zend_file_handle * file_handle );
@@ -1071,10 +1077,6 @@ ZEND_API zend_string *zend_type_to_string(zend_type type);
10711077#define BP_VAR_FUNC_ARG 4
10721078#define BP_VAR_UNSET 5
10731079
1074- #define ZEND_INTERNAL_FUNCTION 1
1075- #define ZEND_USER_FUNCTION 2
1076- #define ZEND_EVAL_CODE 4
1077-
10781080#define ZEND_USER_CODE (type ) ((type) != ZEND_INTERNAL_FUNCTION)
10791081
10801082#define ZEND_INTERNAL_CLASS 1
0 commit comments