php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
zend_exceptions.c File Reference
#include "zend.h"
#include "zend_API.h"
#include "zend_builtin_functions.h"
#include "zend_interfaces.h"
#include "zend_exceptions.h"
#include "zend_vm.h"
#include "zend_dtrace.h"
#include "zend_smart_str.h"
#include "zend_exceptions_arginfo.h"
#include "zend_observer.h"

Go to the source code of this file.

Macros

#define CHECK_EXC_TYPE(id, type)
 
#define GET_PROPERTY(object, id)
 
#define GET_PROPERTY_SILENT(object, id)
 
#define TRACE_APPEND_KEY(key)
 

Functions

ZEND_API zend_class_entryzend_get_exception_base (zend_object *object)
 
void zend_exception_set_previous (zend_object *exception, zend_object *add_previous)
 
void zend_exception_save (void)
 
void zend_exception_restore (void)
 
ZEND_API ZEND_COLD void zend_throw_exception_internal (zend_object *exception)
 
ZEND_API void zend_clear_exception (void)
 
ZEND_COLD ZEND_METHOD (Exception, __clone)
 
 ZEND_METHOD (Exception, __construct)
 
 ZEND_METHOD (Exception, __wakeup)
 
 ZEND_METHOD (ErrorException, __construct)
 
 ZEND_METHOD (Exception, getFile)
 
 ZEND_METHOD (Exception, getLine)
 
 ZEND_METHOD (Exception, getMessage)
 
 ZEND_METHOD (Exception, getCode)
 
 ZEND_METHOD (Exception, getTrace)
 
 ZEND_METHOD (ErrorException, getSeverity)
 
ZEND_API zend_stringzend_trace_to_string (HashTable *trace, bool include_main)
 
 ZEND_METHOD (Exception, getTraceAsString)
 
 ZEND_METHOD (Exception, getPrevious)
 
 ZEND_METHOD (Exception, __toString)
 
void zend_register_default_exception (void)
 
ZEND_API zend_class_entryzend_exception_get_default (void)
 
ZEND_API zend_class_entryzend_get_error_exception (void)
 
ZEND_API ZEND_COLD zend_objectzend_throw_exception (zend_class_entry *exception_ce, const char *message, zend_long code)
 
ZEND_API ZEND_COLD zend_objectzend_throw_exception_ex (zend_class_entry *exception_ce, zend_long code, const char *format,...)
 
ZEND_API ZEND_COLD zend_objectzend_throw_error_exception (zend_class_entry *exception_ce, zend_string *message, zend_long code, int severity)
 
ZEND_API ZEND_COLD zend_result zend_exception_error (zend_object *ex, int severity)
 
ZEND_NORETURN void zend_exception_uncaught_error (const char *format,...)
 
ZEND_API ZEND_COLD void zend_throw_exception_object (zval *exception)
 
ZEND_API ZEND_COLD zend_objectzend_create_unwind_exit (void)
 
ZEND_API ZEND_COLD zend_objectzend_create_graceful_exit (void)
 
ZEND_API ZEND_COLD void zend_throw_unwind_exit (void)
 
ZEND_API ZEND_COLD void zend_throw_graceful_exit (void)
 
ZEND_API bool zend_is_unwind_exit (const zend_object *ex)
 
ZEND_API bool zend_is_graceful_exit (const zend_object *ex)
 

Variables

ZEND_API zend_class_entryzend_ce_throwable
 
ZEND_API zend_class_entryzend_ce_exception
 
ZEND_API zend_class_entryzend_ce_error_exception
 
ZEND_API zend_class_entryzend_ce_error
 
ZEND_API zend_class_entryzend_ce_compile_error
 
ZEND_API zend_class_entryzend_ce_parse_error
 
ZEND_API zend_class_entryzend_ce_type_error
 
ZEND_API zend_class_entryzend_ce_argument_count_error
 
ZEND_API zend_class_entryzend_ce_value_error
 
ZEND_API zend_class_entryzend_ce_arithmetic_error
 
ZEND_API zend_class_entryzend_ce_division_by_zero_error
 
ZEND_API zend_class_entryzend_ce_unhandled_match_error
 
ZEND_API zend_class_entryzend_ce_request_parse_body_exception
 
ZEND_API void(* zend_throw_exception_hook )(zend_object *ex)
 

Macro Definition Documentation

◆ CHECK_EXC_TYPE

#define CHECK_EXC_TYPE ( id,
type )
Value:
pvalue = zend_read_property_ex(i_get_exception_base(Z_OBJ_P(object)), Z_OBJ_P(object), ZSTR_KNOWN(id), 1, &value); \
if (Z_TYPE_P(pvalue) != IS_NULL && Z_TYPE_P(pvalue) != type) { \
zend_unset_property(i_get_exception_base(Z_OBJ_P(object)), Z_OBJ_P(object), ZSTR_VAL(ZSTR_KNOWN(id)), ZSTR_LEN(ZSTR_KNOWN(id))); \
}
zend_ffi_type * type
Definition ffi.c:3812
#define pvalue(o)
Definition minilua.c:245
ZEND_API zval * zend_read_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, bool silent, zval *rv)
Definition zend_API.c:5187
#define ZSTR_VAL(zstr)
Definition zend_string.h:68
#define ZSTR_KNOWN(idx)
#define ZSTR_LEN(zstr)
Definition zend_string.h:69
#define Z_TYPE_P(zval_p)
Definition zend_types.h:660
#define Z_OBJ_P(zval_p)
Definition zend_types.h:990
#define IS_NULL
Definition zend_types.h:601
value

Definition at line 337 of file zend_exceptions.c.

◆ GET_PROPERTY

#define GET_PROPERTY ( object,
id )
Value:
zend_read_property_ex(i_get_exception_base(Z_OBJ_P(object)), Z_OBJ_P(object), ZSTR_KNOWN(id), 0, &rv)
zval rv
Definition session.c:1024

Definition at line 403 of file zend_exceptions.c.

◆ GET_PROPERTY_SILENT

#define GET_PROPERTY_SILENT ( object,
id )
Value:
zend_read_property_ex(i_get_exception_base(Z_OBJ_P(object)), Z_OBJ_P(object), ZSTR_KNOWN(id), 1, &rv)

Definition at line 405 of file zend_exceptions.c.

◆ TRACE_APPEND_KEY

#define TRACE_APPEND_KEY ( key)
Value:
do { \
tmp = zend_hash_find(ht, key); \
if (tmp) { \
if (Z_TYPE_P(tmp) != IS_STRING) { \
zend_error(E_WARNING, "Value for %s is not a string", \
smart_str_appends(str, "[unknown]"); \
} else { \
smart_str_appends(str, Z_STRVAL_P(tmp)); \
} \
} \
} while (0)
HashTable * ht
Definition ffi.c:4838
unsigned char key[REFLECTION_KEY_LEN]
#define E_WARNING
Definition zend_errors.h:24
ZEND_API zval *ZEND_FASTCALL zend_hash_find(const HashTable *ht, zend_string *key)
Definition zend_hash.c:2668
#define Z_STRVAL_P(zval_p)
Definition zend_types.h:975
#define IS_STRING
Definition zend_types.h:606

Definition at line 483 of file zend_exceptions.c.

Function Documentation

◆ zend_clear_exception()

ZEND_API void zend_clear_exception ( void )

Definition at line 234 of file zend_exceptions.c.

◆ zend_create_graceful_exit()

ZEND_API ZEND_COLD zend_object * zend_create_graceful_exit ( void )

Definition at line 1013 of file zend_exceptions.c.

◆ zend_create_unwind_exit()

ZEND_API ZEND_COLD zend_object * zend_create_unwind_exit ( void )

Definition at line 1008 of file zend_exceptions.c.

◆ zend_exception_error()

ZEND_API ZEND_COLD zend_result zend_exception_error ( zend_object * ex,
int severity )

Definition at line 898 of file zend_exceptions.c.

◆ zend_exception_get_default()

ZEND_API zend_class_entry * zend_exception_get_default ( void )

Definition at line 806 of file zend_exceptions.c.

◆ zend_exception_restore()

void zend_exception_restore ( void )

Definition at line 153 of file zend_exceptions.c.

◆ zend_exception_save()

void zend_exception_save ( void )

Definition at line 141 of file zend_exceptions.c.

◆ zend_exception_set_previous()

void zend_exception_set_previous ( zend_object * exception,
zend_object * add_previous )

Definition at line 96 of file zend_exceptions.c.

◆ zend_exception_uncaught_error()

ZEND_NORETURN void zend_exception_uncaught_error ( const char * format,
... )

Definition at line 974 of file zend_exceptions.c.

◆ zend_get_error_exception()

ZEND_API zend_class_entry * zend_get_error_exception ( void )

Definition at line 813 of file zend_exceptions.c.

◆ zend_get_exception_base()

ZEND_API zend_class_entry * zend_get_exception_base ( zend_object * object)

Definition at line 90 of file zend_exceptions.c.

◆ zend_is_graceful_exit()

ZEND_API bool zend_is_graceful_exit ( const zend_object * ex)

Definition at line 1039 of file zend_exceptions.c.

◆ zend_is_unwind_exit()

ZEND_API bool zend_is_unwind_exit ( const zend_object * ex)

Definition at line 1034 of file zend_exceptions.c.

◆ ZEND_METHOD() [1/13]

ZEND_METHOD ( ErrorException ,
__construct  )

Definition at line 356 of file zend_exceptions.c.

◆ ZEND_METHOD() [2/13]

ZEND_METHOD ( ErrorException ,
getSeverity  )

Definition at line 471 of file zend_exceptions.c.

◆ ZEND_METHOD() [3/13]

ZEND_COLD ZEND_METHOD ( Exception ,
__clone  )

Definition at line 298 of file zend_exceptions.c.

◆ ZEND_METHOD() [4/13]

ZEND_METHOD ( Exception ,
__construct  )

Definition at line 306 of file zend_exceptions.c.

◆ ZEND_METHOD() [5/13]

ZEND_METHOD ( Exception ,
__toString  )

Definition at line 649 of file zend_exceptions.c.

◆ ZEND_METHOD() [6/13]

ZEND_METHOD ( Exception ,
__wakeup  )

Definition at line 343 of file zend_exceptions.c.

◆ ZEND_METHOD() [7/13]

ZEND_METHOD ( Exception ,
getCode  )

Definition at line 445 of file zend_exceptions.c.

◆ ZEND_METHOD() [8/13]

ZEND_METHOD ( Exception ,
getFile  )

Definition at line 409 of file zend_exceptions.c.

◆ ZEND_METHOD() [9/13]

ZEND_METHOD ( Exception ,
getLine  )

Definition at line 421 of file zend_exceptions.c.

◆ ZEND_METHOD() [10/13]

ZEND_METHOD ( Exception ,
getMessage  )

Definition at line 433 of file zend_exceptions.c.

◆ ZEND_METHOD() [11/13]

ZEND_METHOD ( Exception ,
getPrevious  )

Definition at line 639 of file zend_exceptions.c.

◆ ZEND_METHOD() [12/13]

ZEND_METHOD ( Exception ,
getTrace  )

Definition at line 458 of file zend_exceptions.c.

◆ ZEND_METHOD() [13/13]

ZEND_METHOD ( Exception ,
getTraceAsString  )

Definition at line 618 of file zend_exceptions.c.

◆ zend_register_default_exception()

void zend_register_default_exception ( void )

Definition at line 755 of file zend_exceptions.c.

◆ zend_throw_error_exception()

ZEND_API ZEND_COLD zend_object * zend_throw_error_exception ( zend_class_entry * exception_ce,
zend_string * message,
zend_long code,
int severity )

Definition at line 873 of file zend_exceptions.c.

◆ zend_throw_exception()

ZEND_API ZEND_COLD zend_object * zend_throw_exception ( zend_class_entry * exception_ce,
const char * message,
zend_long code )

Definition at line 847 of file zend_exceptions.c.

◆ zend_throw_exception_ex()

ZEND_API ZEND_COLD zend_object * zend_throw_exception_ex ( zend_class_entry * exception_ce,
zend_long code,
const char * format,
... )

Definition at line 858 of file zend_exceptions.c.

◆ zend_throw_exception_internal()

ZEND_API ZEND_COLD void zend_throw_exception_internal ( zend_object * exception)

Definition at line 174 of file zend_exceptions.c.

◆ zend_throw_exception_object()

ZEND_API ZEND_COLD void zend_throw_exception_object ( zval * exception)

Definition at line 990 of file zend_exceptions.c.

◆ zend_throw_graceful_exit()

ZEND_API ZEND_COLD void zend_throw_graceful_exit ( void )

Definition at line 1026 of file zend_exceptions.c.

◆ zend_throw_unwind_exit()

ZEND_API ZEND_COLD void zend_throw_unwind_exit ( void )

Definition at line 1018 of file zend_exceptions.c.

◆ zend_trace_to_string()

ZEND_API zend_string * zend_trace_to_string ( HashTable * trace,
bool include_main )

Definition at line 592 of file zend_exceptions.c.

Variable Documentation

◆ zend_ce_argument_count_error

ZEND_API zend_class_entry* zend_ce_argument_count_error

Definition at line 40 of file zend_exceptions.c.

◆ zend_ce_arithmetic_error

ZEND_API zend_class_entry* zend_ce_arithmetic_error

Definition at line 42 of file zend_exceptions.c.

◆ zend_ce_compile_error

ZEND_API zend_class_entry* zend_ce_compile_error

Definition at line 37 of file zend_exceptions.c.

◆ zend_ce_division_by_zero_error

ZEND_API zend_class_entry* zend_ce_division_by_zero_error

Definition at line 43 of file zend_exceptions.c.

◆ zend_ce_error

ZEND_API zend_class_entry* zend_ce_error

Definition at line 36 of file zend_exceptions.c.

◆ zend_ce_error_exception

ZEND_API zend_class_entry* zend_ce_error_exception

Definition at line 35 of file zend_exceptions.c.

◆ zend_ce_exception

ZEND_API zend_class_entry* zend_ce_exception

Definition at line 34 of file zend_exceptions.c.

◆ zend_ce_parse_error

ZEND_API zend_class_entry* zend_ce_parse_error

Definition at line 38 of file zend_exceptions.c.

◆ zend_ce_request_parse_body_exception

ZEND_API zend_class_entry* zend_ce_request_parse_body_exception

Definition at line 45 of file zend_exceptions.c.

◆ zend_ce_throwable

ZEND_API zend_class_entry* zend_ce_throwable

Definition at line 33 of file zend_exceptions.c.

◆ zend_ce_type_error

ZEND_API zend_class_entry* zend_ce_type_error

Definition at line 39 of file zend_exceptions.c.

◆ zend_ce_unhandled_match_error

ZEND_API zend_class_entry* zend_ce_unhandled_match_error

Definition at line 44 of file zend_exceptions.c.

◆ zend_ce_value_error

ZEND_API zend_class_entry* zend_ce_value_error

Definition at line 41 of file zend_exceptions.c.

◆ zend_throw_exception_hook

ZEND_API void(* zend_throw_exception_hook) (zend_object *ex) ( zend_object * ex)

Definition at line 53 of file zend_exceptions.c.