php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
zend.c File Reference
#include "zend.h"
#include "zend_extensions.h"
#include "zend_modules.h"
#include "zend_constants.h"
#include "zend_list.h"
#include "zend_API.h"
#include "zend_exceptions.h"
#include "zend_builtin_functions.h"
#include "zend_ini.h"
#include "zend_vm.h"
#include "zend_dtrace.h"
#include "zend_virtual_cwd.h"
#include "zend_smart_str.h"
#include "zend_smart_string.h"
#include "zend_cpuinfo.h"
#include "zend_attributes.h"
#include "zend_observer.h"
#include "zend_fibers.h"
#include "zend_call_stack.h"
#include "zend_max_execution_timer.h"
#include "zend_hrtime.h"
#include "Optimizer/zend_optimizer.h"
#include "php.h"
#include "php_globals.h"

Go to the source code of this file.

Macros

#define GLOBAL_FUNCTION_TABLE   CG(function_table)
 
#define GLOBAL_CLASS_TABLE   CG(class_table)
 
#define GLOBAL_AUTO_GLOBALS_TABLE   CG(auto_globals)
 
#define GLOBAL_CONSTANTS_TABLE   EG(zend_constants)
 
#define ZEND_CORE_VERSION_INFO   "Zend Engine v" ZEND_VERSION ", Copyright (c) Zend Technologies\n"
 
#define PRINT_ZVAL_INDENT   4
 
#define SIGNAL_CHECK_DEFAULT   "0"
 
#define short_tags_default   1
 
#define compiler_options_default   ZEND_COMPILE_DEFAULT
 
#define SAVE_STACK(stack)
 
#define RESTORE_STACK(stack)
 
#define zend_error_impl(type, format)
 
#define zend_error_noreturn_impl(type, format)
 
#define COMPILED_STRING_DESCRIPTION_FORMAT   "%s(%d) : %s"
 

Functions

ZEND_API size_t zend_vspprintf (char **pbuf, size_t max_len, const char *format, va_list ap)
 
ZEND_API size_t zend_spprintf (char **message, size_t max_len, const char *format,...)
 
ZEND_API size_t zend_spprintf_unchecked (char **message, size_t max_len, const char *format,...)
 
ZEND_API zend_stringzend_vstrpprintf (size_t max_len, const char *format, va_list ap)
 
ZEND_API zend_stringzend_strpprintf (size_t max_len, const char *format,...)
 
ZEND_API zend_stringzend_strpprintf_unchecked (size_t max_len, const char *format,...)
 
ZEND_API bool zend_make_printable_zval (zval *expr, zval *expr_copy)
 
ZEND_API size_t zend_print_zval (zval *expr, int indent)
 
void zend_print_flat_zval_r_to_buf (smart_str *buf, zval *expr)
 
ZEND_API void zend_print_flat_zval_r (zval *expr)
 
ZEND_API zend_stringzend_print_zval_r_to_str (zval *expr, int indent)
 
ZEND_API void zend_print_zval_r (zval *expr, int indent)
 
void zend_startup (zend_utility_functions *utility_functions)
 
void zend_register_standard_ini_entries (void)
 
zend_result zend_post_startup (void)
 
void zend_shutdown (void)
 
void zend_set_utility_values (zend_utility_values *utility_values)
 
ZEND_COLD void zenderror (const char *error)
 
ZEND_API ZEND_COLD ZEND_NORETURN void _zend_bailout (const char *filename, uint32_t lineno)
 
ZEND_API size_t zend_get_page_size (void)
 
ZEND_API void zend_append_version_info (const zend_extension *extension)
 
ZEND_API const char * get_zend_version (void)
 
ZEND_API void zend_activate (void)
 
void zend_call_destructors (void)
 
ZEND_API void zend_deactivate (void)
 
ZEND_API void zend_message_dispatcher (zend_long message, const void *data)
 
ZEND_API zvalzend_get_configuration_directive (zend_string *name)
 
ZEND_API ZEND_COLD void zend_error_zstr_at (int orig_type, zend_string *error_filename, uint32_t error_lineno, zend_string *message)
 
ZEND_API ZEND_COLD void zend_error_at (int type, zend_string *filename, uint32_t lineno, const char *format,...)
 
ZEND_API ZEND_COLD void zend_error (int type, const char *format,...)
 
ZEND_API ZEND_COLD void zend_error_unchecked (int type, const char *format,...)
 
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_at_noreturn (int type, zend_string *filename, uint32_t lineno, const char *format,...)
 
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn (int type, const char *format,...)
 
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn_unchecked (int type, const char *format,...)
 
ZEND_API ZEND_COLD ZEND_NORETURN void zend_strerror_noreturn (int type, int errn, const char *message)
 
ZEND_API ZEND_COLD void zend_error_zstr (int type, zend_string *message)
 
ZEND_API void zend_begin_record_errors (void)
 
ZEND_API void zend_emit_recorded_errors (void)
 
ZEND_API void zend_free_recorded_errors (void)
 
ZEND_API ZEND_COLD void zend_throw_error (zend_class_entry *exception_ce, const char *format,...)
 
ZEND_API ZEND_COLD void zend_illegal_container_offset (const zend_string *container, const zval *offset, int type)
 
ZEND_API ZEND_COLD void zend_type_error (const char *format,...)
 
ZEND_API ZEND_COLD void zend_argument_count_error (const char *format,...)
 
ZEND_API ZEND_COLD void zend_value_error (const char *format,...)
 
ZEND_API ZEND_COLD void zend_output_debug_string (bool trigger_break, const char *format,...)
 
ZEND_API ZEND_COLD void zend_user_exception_handler (void)
 
ZEND_API zend_result zend_execute_script (int type, zval *retval, zend_file_handle *file_handle)
 
ZEND_API zend_result zend_execute_scripts (int type, zval *retval, int file_count,...)
 
ZEND_API char * zend_make_compiled_string_description (const char *name)
 
void free_estring (char **str_p)
 
ZEND_API void zend_map_ptr_reset (void)
 
ZEND_API voidzend_map_ptr_new (void)
 
ZEND_API voidzend_map_ptr_new_static (void)
 
ZEND_API void zend_map_ptr_extend (size_t last)
 
ZEND_API void zend_alloc_ce_cache (zend_string *type_name)
 

Variables

ZEND_API zend_utility_values zend_uv
 
ZEND_API bool zend_dtrace_enabled
 
ZEND_API zend_class_entryzend_standard_class_def = NULL
 
ZEND_API size_t(* zend_printf )(const char *format,...)
 
ZEND_API zend_write_func_t zend_write
 
ZEND_API FILE *(* zend_fopen )(zend_string *filename, zend_string **opened_path)
 
ZEND_API zend_result(* zend_stream_open_function )(zend_file_handle *handle)
 
ZEND_API void(* zend_ticks_function )(int ticks)
 
ZEND_API void(* zend_interrupt_function )(zend_execute_data *execute_data)
 
ZEND_API void(* zend_error_cb )(int type, zend_string *error_filename, const uint32_t error_lineno, zend_string *message)
 
void(* zend_printf_to_smart_string )(smart_string *buf, const char *format, va_list ap)
 
void(* zend_printf_to_smart_str )(smart_str *buf, const char *format, va_list ap)
 
ZEND_API char *(* zend_getenv )(const char *name, size_t name_len)
 
ZEND_API zend_string *(* zend_resolve_path )(zend_string *filename)
 
ZEND_API zend_result(* zend_post_startup_cb )(void) = NULL
 
ZEND_API void(* zend_post_shutdown_cb )(void) = NULL
 
ZEND_API void(* zend_accel_schedule_restart_hook )(int reason) = NULL
 
ZEND_ATTRIBUTE_NONNULL ZEND_API zend_result(* zend_random_bytes )(void *bytes, size_t size, char *errstr, size_t errstr_size) = NULL
 
ZEND_ATTRIBUTE_NONNULL ZEND_API void(* zend_random_bytes_insecure )(zend_random_bytes_insecure_state *state, void *bytes, size_t size) = NULL
 
void(* zend_on_timeout )(int seconds)
 
ZEND_API size_t zend_map_ptr_static_size
 
ZEND_API size_t zend_map_ptr_static_last
 

Macro Definition Documentation

◆ COMPILED_STRING_DESCRIPTION_FORMAT

#define COMPILED_STRING_DESCRIPTION_FORMAT   "%s(%d) : %s"

Definition at line 1978 of file zend.c.

◆ compiler_options_default

#define compiler_options_default   ZEND_COMPILE_DEFAULT

Definition at line 647 of file zend.c.

◆ GLOBAL_AUTO_GLOBALS_TABLE

#define GLOBAL_AUTO_GLOBALS_TABLE   CG(auto_globals)

Definition at line 69 of file zend.c.

◆ GLOBAL_CLASS_TABLE

#define GLOBAL_CLASS_TABLE   CG(class_table)

Definition at line 68 of file zend.c.

◆ GLOBAL_CONSTANTS_TABLE

#define GLOBAL_CONSTANTS_TABLE   EG(zend_constants)

Definition at line 70 of file zend.c.

◆ GLOBAL_FUNCTION_TABLE

#define GLOBAL_FUNCTION_TABLE   CG(function_table)

Definition at line 67 of file zend.c.

◆ PRINT_ZVAL_INDENT

#define PRINT_ZVAL_INDENT   4

Definition at line 80 of file zend.c.

◆ RESTORE_STACK

#define RESTORE_STACK ( stack)
Value:
do { \
if (stack.top) { \
zend_stack_destroy(&CG(stack)); \
memcpy(&CG(stack), &stack, sizeof(zend_stack)); \
} \
} while (0)
#define CG(v)
struct _zend_stack zend_stack

Definition at line 1421 of file zend.c.

◆ SAVE_STACK

#define SAVE_STACK ( stack)
Value:
do { \
if (CG(stack).top) { \
memcpy(&stack, &CG(stack), sizeof(zend_stack)); \
CG(stack).top = CG(stack).max = 0; \
CG(stack).elements = NULL; \
} else { \
stack.top = 0; \
} \
} while (0)
#define NULL
Definition gdcache.h:45
original_stack top

Definition at line 1411 of file zend.c.

◆ short_tags_default

#define short_tags_default   1

Definition at line 646 of file zend.c.

◆ SIGNAL_CHECK_DEFAULT

#define SIGNAL_CHECK_DEFAULT   "0"

Definition at line 258 of file zend.c.

◆ ZEND_CORE_VERSION_INFO

#define ZEND_CORE_VERSION_INFO   "Zend Engine v" ZEND_VERSION ", Copyright (c) Zend Technologies\n"

Definition at line 79 of file zend.c.

◆ zend_error_impl

#define zend_error_impl ( type,
format )
Value:
do { \
zend_string *filename; \
uint32_t lineno; \
va_list args; \
get_filename_lineno(type, &filename, &lineno); \
va_start(args, format); \
zend_error_va_list(type, filename, lineno, format, args); \
va_end(args); \
} while (0)
zend_ffi_type * type
Definition ffi.c:3812
zval * args
struct _zend_string zend_string

Definition at line 1656 of file zend.c.

◆ zend_error_noreturn_impl

#define zend_error_noreturn_impl ( type,
format )
Value:
do { \
zend_string *filename; \
uint32_t lineno; \
va_list args; \
get_filename_lineno(type, &filename, &lineno); \
va_start(args, format); \
zend_error_va_list(type, filename, lineno, format, args); \
va_end(args); \
/* Should never reach this. */ \
abort(); \
} while (0)

Definition at line 1691 of file zend.c.

Function Documentation

◆ _zend_bailout()

ZEND_API ZEND_COLD ZEND_NORETURN void _zend_bailout ( const char * filename,
uint32_t lineno )

Definition at line 1252 of file zend.c.

◆ free_estring()

void free_estring ( char ** str_p)

Definition at line 2002 of file zend.c.

◆ get_zend_version()

ZEND_API const char * get_zend_version ( void )

Definition at line 1306 of file zend.c.

◆ zend_activate()

ZEND_API void zend_activate ( void )

Definition at line 1312 of file zend.c.

◆ zend_alloc_ce_cache()

ZEND_API void zend_alloc_ce_cache ( zend_string * type_name)

Definition at line 2070 of file zend.c.

◆ zend_append_version_info()

ZEND_API void zend_append_version_info ( const zend_extension * extension)

Definition at line 1284 of file zend.c.

◆ zend_argument_count_error()

ZEND_API ZEND_COLD void zend_argument_count_error ( const char * format,
... )

Definition at line 1836 of file zend.c.

◆ zend_begin_record_errors()

ZEND_API void zend_begin_record_errors ( void )

Definition at line 1738 of file zend.c.

◆ zend_call_destructors()

void zend_call_destructors ( void )

Definition at line 1329 of file zend.c.

◆ zend_deactivate()

ZEND_API void zend_deactivate ( void )

Definition at line 1337 of file zend.c.

◆ zend_emit_recorded_errors()

ZEND_API void zend_emit_recorded_errors ( void )

Definition at line 1746 of file zend.c.

◆ zend_error()

ZEND_API ZEND_COLD void zend_error ( int type,
const char * format,
... )

Definition at line 1666 of file zend.c.

◆ zend_error_at()

ZEND_API ZEND_COLD void zend_error_at ( int type,
zend_string * filename,
uint32_t lineno,
const char * format,
... )

Definition at line 1642 of file zend.c.

◆ zend_error_at_noreturn()

ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_at_noreturn ( int type,
zend_string * filename,
uint32_t lineno,
const char * format,
... )

Definition at line 1674 of file zend.c.

◆ zend_error_noreturn()

ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn ( int type,
const char * format,
... )

Definition at line 1703 of file zend.c.

◆ zend_error_noreturn_unchecked()

ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn_unchecked ( int type,
const char * format,
... )

Definition at line 1708 of file zend.c.

◆ zend_error_unchecked()

ZEND_API ZEND_COLD void zend_error_unchecked ( int type,
const char * format,
... )

Definition at line 1670 of file zend.c.

◆ zend_error_zstr()

ZEND_API ZEND_COLD void zend_error_zstr ( int type,
zend_string * message )

Definition at line 1731 of file zend.c.

◆ zend_error_zstr_at()

ZEND_API ZEND_COLD void zend_error_zstr_at ( int orig_type,
zend_string * error_filename,
uint32_t error_lineno,
zend_string * message )

Definition at line 1428 of file zend.c.

◆ zend_execute_script()

ZEND_API zend_result zend_execute_script ( int type,
zval * retval,
zend_file_handle * file_handle )

Definition at line 1925 of file zend.c.

◆ zend_execute_scripts()

ZEND_API zend_result zend_execute_scripts ( int type,
zval * retval,
int file_count,
... )

Definition at line 1954 of file zend.c.

◆ zend_free_recorded_errors()

ZEND_API void zend_free_recorded_errors ( void )

Definition at line 1755 of file zend.c.

◆ zend_get_configuration_directive()

ZEND_API zval * zend_get_configuration_directive ( zend_string * name)

Definition at line 1401 of file zend.c.

◆ zend_get_page_size()

ZEND_API size_t zend_get_page_size ( void )

Definition at line 1269 of file zend.c.

◆ zend_illegal_container_offset()

ZEND_API ZEND_COLD void zend_illegal_container_offset ( const zend_string * container,
const zval * offset,
int type )

Definition at line 1802 of file zend.c.

◆ zend_make_compiled_string_description()

ZEND_API char * zend_make_compiled_string_description ( const char * name)

Definition at line 1980 of file zend.c.

◆ zend_make_printable_zval()

ZEND_API bool zend_make_printable_zval ( zval * expr,
zval * expr_copy )

Definition at line 453 of file zend.c.

◆ zend_map_ptr_extend()

ZEND_API void zend_map_ptr_extend ( size_t last)

Definition at line 2053 of file zend.c.

◆ zend_map_ptr_new()

ZEND_API void * zend_map_ptr_new ( void )

Definition at line 2016 of file zend.c.

◆ zend_map_ptr_new_static()

ZEND_API void * zend_map_ptr_new_static ( void )

Definition at line 2032 of file zend.c.

◆ zend_map_ptr_reset()

ZEND_API void zend_map_ptr_reset ( void )

Definition at line 2011 of file zend.c.

◆ zend_message_dispatcher()

ZEND_API void zend_message_dispatcher ( zend_long message,
const void * data )

Definition at line 1393 of file zend.c.

◆ zend_output_debug_string()

ZEND_API ZEND_COLD void zend_output_debug_string ( bool trigger_break,
const char * format,
... )

Definition at line 1861 of file zend.c.

◆ zend_post_startup()

zend_result zend_post_startup ( void )

Definition at line 1090 of file zend.c.

◆ zend_print_flat_zval_r()

ZEND_API void zend_print_flat_zval_r ( zval * expr)

Definition at line 534 of file zend.c.

◆ zend_print_flat_zval_r_to_buf()

void zend_print_flat_zval_r_to_buf ( smart_str * buf,
zval * expr )

Definition at line 479 of file zend.c.

◆ zend_print_zval()

ZEND_API size_t zend_print_zval ( zval * expr,
int indent )

Definition at line 464 of file zend.c.

◆ zend_print_zval_r()

ZEND_API void zend_print_zval_r ( zval * expr,
int indent )

Definition at line 625 of file zend.c.

◆ zend_print_zval_r_to_str()

ZEND_API zend_string * zend_print_zval_r_to_str ( zval * expr,
int indent )

Definition at line 616 of file zend.c.

◆ zend_register_standard_ini_entries()

void zend_register_standard_ini_entries ( void )

Definition at line 1080 of file zend.c.

◆ zend_set_utility_values()

void zend_set_utility_values ( zend_utility_values * utility_values)

Definition at line 1232 of file zend.c.

◆ zend_shutdown()

void zend_shutdown ( void )

Definition at line 1158 of file zend.c.

◆ zend_spprintf()

ZEND_API size_t zend_spprintf ( char ** message,
size_t max_len,
const char * format,
... )

Definition at line 311 of file zend.c.

◆ zend_spprintf_unchecked()

ZEND_API size_t zend_spprintf_unchecked ( char ** message,
size_t max_len,
const char * format,
... )

Definition at line 323 of file zend.c.

◆ zend_startup()

void zend_startup ( zend_utility_functions * utility_functions)

Definition at line 916 of file zend.c.

◆ zend_strerror_noreturn()

ZEND_API ZEND_COLD ZEND_NORETURN void zend_strerror_noreturn ( int type,
int errn,
const char * message )

Definition at line 1713 of file zend.c.

◆ zend_strpprintf()

ZEND_API zend_string * zend_strpprintf ( size_t max_len,
const char * format,
... )

Definition at line 353 of file zend.c.

◆ zend_strpprintf_unchecked()

ZEND_API zend_string * zend_strpprintf_unchecked ( size_t max_len,
const char * format,
... )

Definition at line 365 of file zend.c.

◆ zend_throw_error()

ZEND_API ZEND_COLD void zend_throw_error ( zend_class_entry * exception_ce,
const char * format,
... )

Definition at line 1772 of file zend.c.

◆ zend_type_error()

ZEND_API ZEND_COLD void zend_type_error ( const char * format,
... )

Definition at line 1824 of file zend.c.

◆ zend_user_exception_handler()

ZEND_API ZEND_COLD void zend_user_exception_handler ( void )

Definition at line 1887 of file zend.c.

◆ zend_value_error()

ZEND_API ZEND_COLD void zend_value_error ( const char * format,
... )

Definition at line 1849 of file zend.c.

◆ zend_vspprintf()

ZEND_API size_t zend_vspprintf ( char ** pbuf,
size_t max_len,
const char * format,
va_list ap )

Definition at line 283 of file zend.c.

◆ zend_vstrpprintf()

ZEND_API zend_string * zend_vstrpprintf ( size_t max_len,
const char * format,
va_list ap )

Definition at line 335 of file zend.c.

◆ zenderror()

ZEND_COLD void zenderror ( const char * error)

Definition at line 1239 of file zend.c.

Variable Documentation

◆ zend_accel_schedule_restart_hook

ZEND_API void(* zend_accel_schedule_restart_hook) (int reason) ( int reason) = NULL

Definition at line 97 of file zend.c.

◆ zend_dtrace_enabled

ZEND_API bool zend_dtrace_enabled

Definition at line 74 of file zend.c.

◆ zend_error_cb

ZEND_API void(* zend_error_cb) (int type, zend_string *error_filename, const uint32_t error_lineno, zend_string *message) ( int type,
zend_string * error_filename,
const uint32_t error_lineno,
zend_string * message )

Definition at line 90 of file zend.c.

◆ zend_fopen

ZEND_API FILE *(* zend_fopen) (zend_string *filename, zend_string **opened_path) ( zend_string * filename,
zend_string ** opened_path )

Definition at line 86 of file zend.c.

◆ zend_getenv

ZEND_API char *(* zend_getenv) (const char *name, size_t name_len) ( const char * name,
size_t name_len )

Definition at line 93 of file zend.c.

◆ zend_interrupt_function

ZEND_API void(* zend_interrupt_function) (zend_execute_data *execute_data) ( zend_execute_data * execute_data)

Definition at line 89 of file zend.c.

◆ zend_map_ptr_static_last

ZEND_API size_t zend_map_ptr_static_last

Definition at line 2009 of file zend.c.

◆ zend_map_ptr_static_size

ZEND_API size_t zend_map_ptr_static_size

Definition at line 2008 of file zend.c.

◆ zend_on_timeout

void(* zend_on_timeout) (int seconds) ( int seconds)

Definition at line 102 of file zend.c.

◆ zend_post_shutdown_cb

ZEND_API void(* zend_post_shutdown_cb) (void) ( void ) = NULL

Definition at line 96 of file zend.c.

◆ zend_post_startup_cb

ZEND_API zend_result(* zend_post_startup_cb) (void) ( void ) = NULL

Definition at line 95 of file zend.c.

◆ zend_printf

ZEND_API size_t(* zend_printf) (const char *format,...) ( const char * format,
... )

Definition at line 84 of file zend.c.

◆ zend_printf_to_smart_str

void(* zend_printf_to_smart_str) (smart_str *buf, const char *format, va_list ap) ( smart_str * buf,
const char * format,
va_list ap )

Definition at line 92 of file zend.c.

◆ zend_printf_to_smart_string

void(* zend_printf_to_smart_string) (smart_string *buf, const char *format, va_list ap) ( smart_string * buf,
const char * format,
va_list ap )

Definition at line 91 of file zend.c.

◆ zend_random_bytes

ZEND_ATTRIBUTE_NONNULL ZEND_API zend_result(* zend_random_bytes) (void *bytes, size_t size, char *errstr, size_t errstr_size) ( void * bytes,
size_t size,
char * errstr,
size_t errstr_size ) = NULL

Definition at line 98 of file zend.c.

◆ zend_random_bytes_insecure

ZEND_ATTRIBUTE_NONNULL ZEND_API void(* zend_random_bytes_insecure) (zend_random_bytes_insecure_state *state, void *bytes, size_t size) ( zend_random_bytes_insecure_state * state,
void * bytes,
size_t size ) = NULL

Definition at line 99 of file zend.c.

◆ zend_resolve_path

ZEND_API zend_string *(* zend_resolve_path) (zend_string *filename) ( zend_string * filename)

Definition at line 94 of file zend.c.

◆ zend_standard_class_def

ZEND_API zend_class_entry* zend_standard_class_def = NULL

Definition at line 83 of file zend.c.

◆ zend_stream_open_function

ZEND_API zend_result(* zend_stream_open_function) (zend_file_handle *handle) ( zend_file_handle * handle)

Definition at line 87 of file zend.c.

◆ zend_ticks_function

ZEND_API void(* zend_ticks_function) (int ticks) ( int ticks)

Definition at line 88 of file zend.c.

◆ zend_uv

Definition at line 73 of file zend.c.

◆ zend_write

Definition at line 85 of file zend.c.