From bc6199757168eee4bd1d0a0d28a36c242bdcf13d Mon Sep 17 00:00:00 2001 From: Peter Cowburn Date: Wed, 4 Sep 2019 21:39:02 +0100 Subject: add ValueError ValueError is intended to be thrown when a function or method receives an argument that has the right type (incorrect type should throw a TypeError) but an inappropriate value. --- Zend/zend_exceptions.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Zend/zend_exceptions.c') diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index b9dd9a9257..9fd0176c34 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -36,6 +36,7 @@ ZEND_API zend_class_entry *zend_ce_compile_error; ZEND_API zend_class_entry *zend_ce_parse_error; ZEND_API zend_class_entry *zend_ce_type_error; ZEND_API zend_class_entry *zend_ce_argument_count_error; +ZEND_API zend_class_entry *zend_ce_value_error; ZEND_API zend_class_entry *zend_ce_arithmetic_error; ZEND_API zend_class_entry *zend_ce_division_by_zero_error; @@ -872,6 +873,10 @@ void zend_register_default_exception(void) /* {{{ */ zend_ce_argument_count_error = zend_register_internal_class_ex(&ce, zend_ce_type_error); zend_ce_argument_count_error->create_object = zend_default_exception_new; + INIT_CLASS_ENTRY(ce, "ValueError", NULL); + zend_ce_value_error = zend_register_internal_class_ex(&ce, zend_ce_error); + zend_ce_value_error->create_object = zend_default_exception_new; + INIT_CLASS_ENTRY(ce, "ArithmeticError", NULL); zend_ce_arithmetic_error = zend_register_internal_class_ex(&ce, zend_ce_error); zend_ce_arithmetic_error->create_object = zend_default_exception_new; -- cgit v1.2.1