]> granicus.if.org Git - php/commitdiff
Switch position of ce in exception ce variable names
authorAaron Piotrowski <aaron@trowski.com>
Fri, 3 Jul 2015 14:45:03 +0000 (09:45 -0500)
committerAaron Piotrowski <aaron@trowski.com>
Fri, 3 Jul 2015 14:45:03 +0000 (09:45 -0500)
21 files changed:
Zend/zend.c
Zend/zend_exceptions.c
Zend/zend_exceptions.h
Zend/zend_generators.c
Zend/zend_language_scanner.c
Zend/zend_language_scanner.l
ext/com_dotnet/com_extension.c
ext/dom/php_dom.c
ext/intl/intl_error.c
ext/mysqli/mysqli.c
ext/pdo/pdo.c
ext/pgsql/pgsql.c
ext/phar/phar_object.c
ext/reflection/php_reflection.c
ext/simplexml/simplexml.c
ext/snmp/snmp.c
ext/soap/soap.c
ext/spl/spl_exceptions.c
ext/sqlite3/sqlite3.c
ext/standard/assert.c
sapi/cli/php_cli.c

index 1a74d316c05377887619f468e95451a4174d7688..e824b75c8db8e398abaeb60b36906342e5d2e751 100644 (file)
@@ -882,7 +882,7 @@ void zenderror(const char *error) /* {{{ */
                return;
        }
 
-       zend_throw_exception(zend_parse_error_ce, error, E_PARSE);
+       zend_throw_exception(zend_ce_parse_error, error, E_PARSE);
 }
 /* }}} */
 
@@ -1059,7 +1059,7 @@ static void zend_error_va_list(int type, const char *format, va_list args)
                        va_start(args, format);
 #endif
                        zend_vspprintf(&message, 0, format, args);
-                       zend_throw_exception(zend_error_ce, message, type);
+                       zend_throw_exception(zend_ce_error, message, type);
                        efree(message);
 #if !defined(HAVE_NORETURN) || defined(HAVE_NORETURN_ALIAS)
                        va_end(args);
@@ -1318,7 +1318,7 @@ ZEND_API void zend_type_error(const char *format, ...) /* {{{ */
 
        va_start(va, format);
        zend_vspprintf(&message, 0, format, va);
-       zend_throw_exception(zend_type_error_ce, message, E_ERROR);
+       zend_throw_exception(zend_ce_type_error, message, E_ERROR);
        efree(message);
        va_end(va);
 } /* }}} */
@@ -1331,7 +1331,7 @@ ZEND_API void zend_internal_type_error(zend_bool throw_exception, const char *fo
        va_start(va, format);
        zend_vspprintf(&message, 0, format, va);
        if (throw_exception) {
-               zend_throw_exception(zend_type_error_ce, message, E_ERROR);
+               zend_throw_exception(zend_ce_type_error, message, E_ERROR);
        } else {
                zend_error(E_WARNING, message);
        }
index 0f3ad2b06afff54d874458a1c0708dd3629efd80..9a1b79184ad1ee8f13ce025f1f59dbc73dfa821b 100644 (file)
 #include "zend_smart_str.h"
 
 ZEND_API zend_class_entry *zend_ce_throwable;
-ZEND_API zend_class_entry *zend_exception_ce;
-ZEND_API zend_class_entry *zend_error_exception_ce;
-ZEND_API zend_class_entry *zend_error_ce;
-ZEND_API zend_class_entry *zend_parse_error_ce;
-ZEND_API zend_class_entry *zend_type_error_ce;
+ZEND_API zend_class_entry *zend_ce_exception;
+ZEND_API zend_class_entry *zend_ce_error_exception;
+ZEND_API zend_class_entry *zend_ce_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_arithmetic_error;
 ZEND_API zend_class_entry *zend_ce_division_by_zero_error;
 
@@ -46,21 +46,21 @@ static zend_object_handlers default_exception_handlers;
 /* {{{ zend_implement_throwable */
 static int zend_implement_throwable(zend_class_entry *interface, zend_class_entry *class_type)
 {
-       if (instanceof_function(class_type, zend_exception_ce) || instanceof_function(class_type, zend_error_ce)) {
+       if (instanceof_function(class_type, zend_ce_exception) || instanceof_function(class_type, zend_ce_error)) {
                return SUCCESS;
        }
        zend_error_noreturn(E_ERROR, "Class %s cannot implement interface %s, extend %s or %s instead",
                ZSTR_VAL(class_type->name),
                ZSTR_VAL(interface->name),
-               ZSTR_VAL(zend_exception_ce->name),
-               ZSTR_VAL(zend_error_ce->name));
+               ZSTR_VAL(zend_ce_exception->name),
+               ZSTR_VAL(zend_ce_error->name));
        return FAILURE;
 }
 /* }}} */
 
 static inline zend_class_entry *i_get_exception_base(zval *object)
 {
-       return instanceof_function(Z_OBJCE_P(object), zend_exception_ce) ? zend_exception_ce : zend_error_ce;
+       return instanceof_function(Z_OBJCE_P(object), zend_ce_exception) ? zend_ce_exception : zend_ce_error;
 }
 
 ZEND_API zend_class_entry *zend_get_exception_base(zval *object)
@@ -141,7 +141,7 @@ ZEND_API void zend_throw_exception_internal(zval *exception) /* {{{ */
                }
        }
        if (!EG(current_execute_data)) {
-               if (exception && Z_OBJCE_P(exception) == zend_parse_error_ce) {
+               if (exception && Z_OBJCE_P(exception) == zend_ce_parse_error) {
                        return;
                }
                if(EG(exception)) {
@@ -206,7 +206,7 @@ static zend_object *zend_default_exception_new_ex(zend_class_entry *class_type,
        
        base_ce = i_get_exception_base(&obj);
 
-       if (EXPECTED(class_type != zend_parse_error_ce || !(filename = zend_get_compiled_filename()))) {
+       if (EXPECTED(class_type != zend_ce_parse_error || !(filename = zend_get_compiled_filename()))) {
                zend_update_property_string(base_ce, &obj, "file", sizeof("file")-1, zend_get_executed_filename());
                zend_update_property_long(base_ce, &obj, "line", sizeof("line")-1, zend_get_executed_lineno());
        } else {
@@ -295,7 +295,7 @@ ZEND_METHOD(error_exception, __construct)
                if (execute_data->called_scope) {
                        ce = execute_data->called_scope;
                } else {
-                       ce = zend_error_exception_ce;
+                       ce = zend_ce_error_exception;
                }
                zend_error(E_EXCEPTION | E_ERROR, "Wrong parameters for %s([string $message [, long $code, [ long $severity, [ string $filename, [ long $lineno  [, Throwable $previous = NULL]]]]]])", ZSTR_VAL(ce->name));
                return;
@@ -304,25 +304,25 @@ ZEND_METHOD(error_exception, __construct)
        object = getThis();
 
        if (message) {
-               zend_update_property_string(zend_exception_ce, object, "message", sizeof("message")-1, message);
+               zend_update_property_string(zend_ce_exception, object, "message", sizeof("message")-1, message);
        }
 
        if (code) {
-               zend_update_property_long(zend_exception_ce, object, "code", sizeof("code")-1, code);
+               zend_update_property_long(zend_ce_exception, object, "code", sizeof("code")-1, code);
        }
 
        if (previous) {
-               zend_update_property(zend_exception_ce, object, "previous", sizeof("previous")-1, previous);
+               zend_update_property(zend_ce_exception, object, "previous", sizeof("previous")-1, previous);
        }
 
-       zend_update_property_long(zend_error_exception_ce, object, "severity", sizeof("severity")-1, severity);
+       zend_update_property_long(zend_ce_error_exception, object, "severity", sizeof("severity")-1, severity);
 
        if (argc >= 4) {
-           zend_update_property_string(zend_exception_ce, object, "file", sizeof("file")-1, filename);
+           zend_update_property_string(zend_ce_exception, object, "file", sizeof("file")-1, filename);
        if (argc < 5) {
            lineno = 0; /* invalidate lineno */
        }
-               zend_update_property_long(zend_exception_ce, object, "line", sizeof("line")-1, lineno);
+               zend_update_property_long(zend_ce_exception, object, "line", sizeof("line")-1, lineno);
        }
 }
 /* }}} */
@@ -709,7 +709,7 @@ ZEND_METHOD(exception, __toString)
                        ZVAL_UNDEF(&trace);
                }
 
-               if (Z_OBJCE_P(exception) == zend_type_error_ce && strstr(ZSTR_VAL(message), ", called in ")) {
+               if (Z_OBJCE_P(exception) == zend_ce_type_error && strstr(ZSTR_VAL(message), ", called in ")) {
                        zend_string *real_message = zend_strpprintf(0, "%s and defined", ZSTR_VAL(message));
                        zend_string_release(message);
                        message = real_message;
@@ -819,46 +819,46 @@ void zend_register_default_exception(void) /* {{{ */
        default_exception_handlers.clone_obj = NULL;
 
        INIT_CLASS_ENTRY(ce, "Exception", default_exception_functions);
-       zend_exception_ce = zend_register_internal_class_ex(&ce, NULL);
-       zend_exception_ce->create_object = zend_default_exception_new;
-       zend_class_implements(zend_exception_ce, 1, zend_ce_throwable);
-
-       zend_declare_property_string(zend_exception_ce, "message", sizeof("message")-1, "", ZEND_ACC_PROTECTED);
-       zend_declare_property_string(zend_exception_ce, "string", sizeof("string")-1, "", ZEND_ACC_PRIVATE);
-       zend_declare_property_long(zend_exception_ce, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED);
-       zend_declare_property_null(zend_exception_ce, "file", sizeof("file")-1, ZEND_ACC_PROTECTED);
-       zend_declare_property_null(zend_exception_ce, "line", sizeof("line")-1, ZEND_ACC_PROTECTED);
-       zend_declare_property_null(zend_exception_ce, "trace", sizeof("trace")-1, ZEND_ACC_PRIVATE);
-       zend_declare_property_null(zend_exception_ce, "previous", sizeof("previous")-1, ZEND_ACC_PRIVATE);      
+       zend_ce_exception = zend_register_internal_class_ex(&ce, NULL);
+       zend_ce_exception->create_object = zend_default_exception_new;
+       zend_class_implements(zend_ce_exception, 1, zend_ce_throwable);
+
+       zend_declare_property_string(zend_ce_exception, "message", sizeof("message")-1, "", ZEND_ACC_PROTECTED);
+       zend_declare_property_string(zend_ce_exception, "string", sizeof("string")-1, "", ZEND_ACC_PRIVATE);
+       zend_declare_property_long(zend_ce_exception, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED);
+       zend_declare_property_null(zend_ce_exception, "file", sizeof("file")-1, ZEND_ACC_PROTECTED);
+       zend_declare_property_null(zend_ce_exception, "line", sizeof("line")-1, ZEND_ACC_PROTECTED);
+       zend_declare_property_null(zend_ce_exception, "trace", sizeof("trace")-1, ZEND_ACC_PRIVATE);
+       zend_declare_property_null(zend_ce_exception, "previous", sizeof("previous")-1, ZEND_ACC_PRIVATE);
 
        INIT_CLASS_ENTRY(ce, "ErrorException", error_exception_functions);
-       zend_error_exception_ce = zend_register_internal_class_ex(&ce, zend_exception_ce);
-       zend_error_exception_ce->create_object = zend_error_exception_new;
-       zend_declare_property_long(zend_error_exception_ce, "severity", sizeof("severity")-1, E_ERROR, ZEND_ACC_PROTECTED);
+       zend_ce_error_exception = zend_register_internal_class_ex(&ce, zend_ce_exception);
+       zend_ce_error_exception->create_object = zend_error_exception_new;
+       zend_declare_property_long(zend_ce_error_exception, "severity", sizeof("severity")-1, E_ERROR, ZEND_ACC_PROTECTED);
 
        INIT_CLASS_ENTRY(ce, "Error", default_exception_functions);
-       zend_error_ce = zend_register_internal_class_ex(&ce, NULL);
-       zend_error_ce->create_object = zend_default_exception_new;
-       zend_class_implements(zend_error_ce, 1, zend_ce_throwable);
-
-       zend_declare_property_string(zend_error_ce, "message", sizeof("message")-1, "", ZEND_ACC_PROTECTED);
-       zend_declare_property_string(zend_error_ce, "string", sizeof("string")-1, "", ZEND_ACC_PRIVATE);
-       zend_declare_property_long(zend_error_ce, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED);
-       zend_declare_property_null(zend_error_ce, "file", sizeof("file")-1, ZEND_ACC_PROTECTED);
-       zend_declare_property_null(zend_error_ce, "line", sizeof("line")-1, ZEND_ACC_PROTECTED);
-       zend_declare_property_null(zend_error_ce, "trace", sizeof("trace")-1, ZEND_ACC_PRIVATE);
-       zend_declare_property_null(zend_error_ce, "previous", sizeof("previous")-1, ZEND_ACC_PRIVATE);  
+       zend_ce_error = zend_register_internal_class_ex(&ce, NULL);
+       zend_ce_error->create_object = zend_default_exception_new;
+       zend_class_implements(zend_ce_error, 1, zend_ce_throwable);
+
+       zend_declare_property_string(zend_ce_error, "message", sizeof("message")-1, "", ZEND_ACC_PROTECTED);
+       zend_declare_property_string(zend_ce_error, "string", sizeof("string")-1, "", ZEND_ACC_PRIVATE);
+       zend_declare_property_long(zend_ce_error, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED);
+       zend_declare_property_null(zend_ce_error, "file", sizeof("file")-1, ZEND_ACC_PROTECTED);
+       zend_declare_property_null(zend_ce_error, "line", sizeof("line")-1, ZEND_ACC_PROTECTED);
+       zend_declare_property_null(zend_ce_error, "trace", sizeof("trace")-1, ZEND_ACC_PRIVATE);
+       zend_declare_property_null(zend_ce_error, "previous", sizeof("previous")-1, ZEND_ACC_PRIVATE);
 
        INIT_CLASS_ENTRY(ce, "ParseError", NULL);
-       zend_parse_error_ce = zend_register_internal_class_ex(&ce, zend_error_ce);
-       zend_parse_error_ce->create_object = zend_default_exception_new;
+       zend_ce_parse_error = zend_register_internal_class_ex(&ce, zend_ce_error);
+       zend_ce_parse_error->create_object = zend_default_exception_new;
 
        INIT_CLASS_ENTRY(ce, "TypeError", NULL);
-       zend_type_error_ce = zend_register_internal_class_ex(&ce, zend_error_ce);
-       zend_type_error_ce->create_object = zend_default_exception_new;
+       zend_ce_type_error = zend_register_internal_class_ex(&ce, zend_ce_error);
+       zend_ce_type_error->create_object = zend_default_exception_new;
 
        INIT_CLASS_ENTRY(ce, "ArithmeticError", NULL);
-       zend_ce_arithmetic_error = zend_register_internal_class_ex(&ce, zend_error_ce);
+       zend_ce_arithmetic_error = zend_register_internal_class_ex(&ce, zend_ce_error);
        zend_ce_arithmetic_error->create_object = zend_default_exception_new;
 
        INIT_CLASS_ENTRY(ce, "DivisionByZeroError", NULL);
@@ -867,17 +867,17 @@ void zend_register_default_exception(void) /* {{{ */
 }
 /* }}} */
 
-/* {{{ Deprecated - Use zend_exception_ce directly instead */
+/* {{{ Deprecated - Use zend_ce_exception directly instead */
 ZEND_API zend_class_entry *zend_exception_get_default(void) 
 {
-       return zend_exception_ce;
+       return zend_ce_exception;
 }
 /* }}} */
 
-/* {{{ Deprecated - Use zend_error_exception_ce directly instead */
+/* {{{ Deprecated - Use zend_ce_error_exception directly instead */
 ZEND_API zend_class_entry *zend_get_error_exception(void)
 {
-       return zend_error_exception_ce;
+       return zend_ce_error_exception;
 }
 /* }}} */
 
@@ -888,10 +888,10 @@ ZEND_API zend_object *zend_throw_exception(zend_class_entry *exception_ce, const
        if (exception_ce) {
                if (!instanceof_function(exception_ce, zend_ce_throwable)) {
                        zend_error(E_NOTICE, "Exceptions must implement Throwable");
-                       exception_ce = zend_exception_ce;
+                       exception_ce = zend_ce_exception;
                }
        } else {
-               exception_ce = zend_exception_ce;
+               exception_ce = zend_ce_exception;
        }
        object_init_ex(&ex, exception_ce);
 
@@ -928,7 +928,7 @@ ZEND_API zend_object *zend_throw_error_exception(zend_class_entry *exception_ce,
        zval ex;
        zend_object *obj = zend_throw_exception(exception_ce, message, code);
        ZVAL_OBJ(&ex, obj);
-       zend_update_property_long(zend_error_exception_ce, &ex, "severity", sizeof("severity")-1, severity);
+       zend_update_property_long(zend_ce_error_exception, &ex, "severity", sizeof("severity")-1, severity);
        return obj;
 }
 /* }}} */
@@ -961,7 +961,7 @@ ZEND_API void zend_exception_error(zend_object *ex, int severity) /* {{{ */
        ZVAL_OBJ(&exception, ex);
        ce_exception = Z_OBJCE(exception);
        EG(exception) = NULL;
-       if (ce_exception == zend_parse_error_ce) {
+       if (ce_exception == zend_ce_parse_error) {
                zend_string *message = zval_get_string(GET_PROPERTY(&exception, "message"));
                zend_string *file = zval_get_string(GET_PROPERTY_SILENT(&exception, "file"));
                zend_long line = zval_get_long(GET_PROPERTY_SILENT(&exception, "line"));
@@ -991,7 +991,7 @@ ZEND_API void zend_exception_error(zend_object *ex, int severity) /* {{{ */
 
                        ZVAL_OBJ(&zv, EG(exception));
                        /* do the best we can to inform about the inner exception */
-                       if (instanceof_function(ce_exception, zend_exception_ce) || instanceof_function(ce_exception, zend_error_ce)) {
+                       if (instanceof_function(ce_exception, zend_ce_exception) || instanceof_function(ce_exception, zend_ce_error)) {
                                file = zval_get_string(GET_PROPERTY_SILENT(&zv, "file"));
                                line = zval_get_long(GET_PROPERTY_SILENT(&zv, "line"));
                        }
index 268109af61aa7cb6685fcb14487ad35e3fdde9b8..f9bf24b4c2b07db28bf7399aab2340ae9f31141a 100644 (file)
 BEGIN_EXTERN_C()
 
 extern ZEND_API zend_class_entry *zend_ce_throwable;
-extern ZEND_API zend_class_entry *zend_exception_ce;
-extern ZEND_API zend_class_entry *zend_error_exception_ce;
-extern ZEND_API zend_class_entry *zend_error_ce;
-extern ZEND_API zend_class_entry *zend_parse_error_ce;
-extern ZEND_API zend_class_entry *zend_type_error_ce;
+extern ZEND_API zend_class_entry *zend_ce_exception;
+extern ZEND_API zend_class_entry *zend_ce_error_exception;
+extern ZEND_API zend_class_entry *zend_ce_error;
+extern ZEND_API zend_class_entry *zend_ce_parse_error;
+extern ZEND_API zend_class_entry *zend_ce_type_error;
 extern ZEND_API zend_class_entry *zend_ce_arithmetic_error;
 extern ZEND_API zend_class_entry *zend_ce_division_by_zero_error;
 
@@ -45,15 +45,15 @@ void zend_register_default_exception(void);
 
 ZEND_API zend_class_entry *zend_get_exception_base(zval *object);
 
-/* Deprecated - Use zend_exception_ce directly instead */
+/* Deprecated - Use zend_ce_exception directly instead */
 ZEND_API zend_class_entry *zend_exception_get_default(void);
 
-/* Deprecated - Use zend_error_exception_ce directly instead */
+/* Deprecated - Use zend_ce_error_exception directly instead */
 ZEND_API zend_class_entry *zend_get_error_exception(void);
 
 ZEND_API void zend_register_default_classes(void);
 
-/* exception_ce   NULL, zend_exception_ce, zend_error_ce, or a derived class
+/* exception_ce   NULL, zend_ce_exception, zend_ce_error, or a derived class
  * message        NULL or the message of the exception */
 ZEND_API zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code);
 ZEND_API zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, zend_long code, const char *format, ...);
index 2c68a3ad7e9be2ef6adc61f5511bead155c0d18e..66692db905144ffbfb6c3054254ddf93b412b5fe 100644 (file)
@@ -1124,7 +1124,7 @@ void zend_register_generator_ce(void) /* {{{ */
        zend_generator_handlers.get_constructor = zend_generator_get_constructor;
 
        INIT_CLASS_ENTRY(ce, "ClosedGeneratorException", NULL);
-       zend_ce_ClosedGeneratorException = zend_register_internal_class_ex(&ce, zend_exception_ce);
+       zend_ce_ClosedGeneratorException = zend_register_internal_class_ex(&ce, zend_ce_exception);
 }
 /* }}} */
 
index 63cab792b3d744873315eb496cd7b4e6e2f8b71a..9e2250b9265348e0180f1079560a77b575e21613 100644 (file)
@@ -1010,7 +1010,7 @@ static int zend_scan_escape_string(zval *zendlval, char *str, int len, char quot
                                                }
 
                                                if (!valid) {
-                                                       zend_throw_exception(zend_parse_error_ce,
+                                                       zend_throw_exception(zend_ce_parse_error,
                                                                "Invalid UTF-8 codepoint escape sequence", E_PARSE);
                                                        zval_ptr_dtor(zendlval);
                                                        return FAILURE;
@@ -1021,7 +1021,7 @@ static int zend_scan_escape_string(zval *zendlval, char *str, int len, char quot
 
                                                /* per RFC 3629, UTF-8 can only represent 21 bits */
                                                if (codepoint > 0x10FFFF || errno) {
-                                                       zend_throw_exception(zend_parse_error_ce,
+                                                       zend_throw_exception(zend_ce_parse_error,
                                                                "Invalid UTF-8 codepoint escape sequence: Codepoint too large", E_PARSE);
                                                        zval_ptr_dtor(zendlval);
                                                        return FAILURE;
@@ -2743,7 +2743,7 @@ yy136:
                 * Because the lexing itself doesn't do that for us
                 */
                if (end != yytext + yyleng) {
-                       zend_throw_exception(zend_parse_error_ce, "Invalid numeric literal", E_PARSE);
+                       zend_throw_exception(zend_ce_parse_error, "Invalid numeric literal", E_PARSE);
                        RETURN_TOKEN(T_ERROR);
                }
        } else {
@@ -2759,7 +2759,7 @@ yy136:
                        }
                        /* Also not an assert for the same reason */
                        if (end != yytext + yyleng) {
-                               zend_throw_exception(zend_parse_error_ce,
+                               zend_throw_exception(zend_ce_parse_error,
                                        "Invalid numeric literal", E_PARSE);
                                RETURN_TOKEN(T_ERROR);
                        }
@@ -2768,7 +2768,7 @@ yy136:
                }
                /* Also not an assert for the same reason */
                if (end != yytext + yyleng) {
-                       zend_throw_exception(zend_parse_error_ce, "Invalid numeric literal", E_PARSE);
+                       zend_throw_exception(zend_ce_parse_error, "Invalid numeric literal", E_PARSE);
                        RETURN_TOKEN(T_ERROR);
                }
        }
index ca2b202dd7582e7635427a8156c59ba9268378eb..4498edae5c6e26fc9e09da08408a8543828d5ee0 100644 (file)
@@ -1008,7 +1008,7 @@ static int zend_scan_escape_string(zval *zendlval, char *str, int len, char quot
                                                }
 
                                                if (!valid) {
-                                                       zend_throw_exception(zend_parse_error_ce,
+                                                       zend_throw_exception(zend_ce_parse_error,
                                                                "Invalid UTF-8 codepoint escape sequence", E_PARSE);
                                                        zval_ptr_dtor(zendlval);
                                                        return FAILURE;
@@ -1019,7 +1019,7 @@ static int zend_scan_escape_string(zval *zendlval, char *str, int len, char quot
 
                                                /* per RFC 3629, UTF-8 can only represent 21 bits */
                                                if (codepoint > 0x10FFFF || errno) {
-                                                       zend_throw_exception(zend_parse_error_ce,
+                                                       zend_throw_exception(zend_ce_parse_error,
                                                                "Invalid UTF-8 codepoint escape sequence: Codepoint too large", E_PARSE);
                                                        zval_ptr_dtor(zendlval);
                                                        return FAILURE;
@@ -1658,7 +1658,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
                 * Because the lexing itself doesn't do that for us
                 */
                if (end != yytext + yyleng) {
-                       zend_throw_exception(zend_parse_error_ce, "Invalid numeric literal", E_PARSE);
+                       zend_throw_exception(zend_ce_parse_error, "Invalid numeric literal", E_PARSE);
                        RETURN_TOKEN(T_ERROR);
                }
        } else {
@@ -1674,7 +1674,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
                        }
                        /* Also not an assert for the same reason */
                        if (end != yytext + yyleng) {
-                               zend_throw_exception(zend_parse_error_ce,
+                               zend_throw_exception(zend_ce_parse_error,
                                        "Invalid numeric literal", E_PARSE);
                                RETURN_TOKEN(T_ERROR);
                        }
@@ -1683,7 +1683,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
                }
                /* Also not an assert for the same reason */
                if (end != yytext + yyleng) {
-                       zend_throw_exception(zend_parse_error_ce, "Invalid numeric literal", E_PARSE);
+                       zend_throw_exception(zend_ce_parse_error, "Invalid numeric literal", E_PARSE);
                        RETURN_TOKEN(T_ERROR);
                }
        }
index 42b6477c147b9abe6de3729f660c441fc03e7ea0..1a3db308feb2493c33f3c0b2be7da627cd9dd63b 100644 (file)
@@ -358,7 +358,7 @@ PHP_MINIT_FUNCTION(com_dotnet)
        php_com_persist_minit(INIT_FUNC_ARGS_PASSTHRU);
 
        INIT_CLASS_ENTRY(ce, "com_exception", NULL);
-       php_com_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_ce);
+       php_com_exception_class_entry = zend_register_internal_class_ex(&ce, zend_ce_exception);
        php_com_exception_class_entry->ce_flags |= ZEND_ACC_FINAL;
 /*     php_com_exception_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */
 
index 3394a9284dc50274a0b2a9a437f8b18c30d6e6b3..35900a58294706901a1d2d65e9107e6f7771f639 100644 (file)
@@ -614,7 +614,7 @@ PHP_MINIT_FUNCTION(dom)
        zend_hash_init(&classes, 0, NULL, NULL, 1);
 
        INIT_CLASS_ENTRY(ce, "DOMException", php_dom_domexception_class_functions);
-       dom_domexception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_ce);
+       dom_domexception_class_entry = zend_register_internal_class_ex(&ce, zend_ce_exception);
        dom_domexception_class_entry->ce_flags |= ZEND_ACC_FINAL;
        zend_declare_property_long(dom_domexception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PUBLIC);
 
index 0118ef652dc17ca3da7066522c51692ad8968913..a88b5595725dd01aedacc442757d311935911c8e 100644 (file)
@@ -237,8 +237,8 @@ void intl_register_IntlException_class( void )
        /* Create and register 'IntlException' class. */
        INIT_CLASS_ENTRY_EX( ce, "IntlException", sizeof( "IntlException" ) - 1, NULL );
        IntlException_ce_ptr = zend_register_internal_class_ex( &ce,
-               zend_exception_ce );
-       IntlException_ce_ptr->create_object = zend_exception_ce->create_object;
+               zend_ce_exception );
+       IntlException_ce_ptr->create_object = zend_ce_exception->create_object;
 }
 
 smart_str intl_parse_error_to_string( UParseError* pe )
index 3665ddc27f66af70da9e6ca62b6cd75c3c6b9315..8039244b5c49db5b7f0005850fd03930a6c1448b 100644 (file)
@@ -606,7 +606,7 @@ PHP_MINIT_FUNCTION(mysqli)
 #ifdef HAVE_SPL
        mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException);
 #else
-       mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, zend_exception_ce);
+       mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, zend_ce_exception);
 #endif
        mysqli_exception_class_entry->ce_flags |= ZEND_ACC_FINAL;
        zend_declare_property_long(mysqli_exception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED);
@@ -1302,7 +1302,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
                                         * single value is an array. Also we'd have to make that one
                                         * argument passed by reference.
                                         */
-                                       zend_throw_exception(zend_exception_ce, "Parameter ctor_params must be an array", 0);
+                                       zend_throw_exception(zend_ce_exception, "Parameter ctor_params must be an array", 0);
                                        return;
                                }
                        }
@@ -1314,7 +1314,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
                        fcc.object = Z_OBJ_P(return_value);
 
                        if (zend_call_function(&fci, &fcc) == FAILURE) {
-                               zend_throw_exception_ex(zend_exception_ce, 0, "Could not execute %s::%s()", ZSTR_VAL(ce->name), ZSTR_VAL(ce->constructor->common.function_name));
+                               zend_throw_exception_ex(zend_ce_exception, 0, "Could not execute %s::%s()", ZSTR_VAL(ce->name), ZSTR_VAL(ce->constructor->common.function_name));
                        } else {
                                zval_ptr_dtor(&retval);
                        }
@@ -1322,7 +1322,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
                                efree(fci.params);
                        }
                } else if (ctor_params) {
-                       zend_throw_exception_ex(zend_exception_ce, 0, "Class %s does not have a constructor hence you cannot use ctor_params", ZSTR_VAL(ce->name));
+                       zend_throw_exception_ex(zend_ce_exception, 0, "Class %s does not have a constructor hence you cannot use ctor_params", ZSTR_VAL(ce->name));
                }
        }
 }
index 3c8b529f3fd39ae77920a1346a89d17ba0d08ea5..15265d9755a34b6405601175ccd496d3ba72a9d0 100644 (file)
@@ -93,7 +93,7 @@ PDO_API zend_class_entry *php_pdo_get_exception_base(int root) /* {{{ */
                }
        }
 #endif
-       return zend_exception_ce;
+       return zend_ce_exception;
 }
 /* }}} */
 
index f8ad8067a7319e5bfd9fe829cd1ef313f1b1732f..9282d483645f3d7f87825baaabc6230d28d274ee 100644 (file)
@@ -2808,7 +2808,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
                                         * single value is an array. Also we'd have to make that one
                                         * argument passed by reference.
                                         */
-                                       zend_throw_exception(zend_exception_ce, "Parameter ctor_params must be an array", 0);
+                                       zend_throw_exception(zend_ce_exception, "Parameter ctor_params must be an array", 0);
                                        return;
                                }
                        }
@@ -2820,7 +2820,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
                        fcc.object = Z_OBJ_P(return_value);
 
                        if (zend_call_function(&fci, &fcc) == FAILURE) {
-                               zend_throw_exception_ex(zend_exception_ce, 0, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name);
+                               zend_throw_exception_ex(zend_ce_exception, 0, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name);
                        } else {
                                zval_ptr_dtor(&retval);
                        }
@@ -2828,7 +2828,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
                                efree(fci.params);
                        }
                } else if (ctor_params) {
-                       zend_throw_exception_ex(zend_exception_ce, 0, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name);
+                       zend_throw_exception_ex(zend_ce_exception, 0, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name);
                }
        }
 }
index 83302616992ac2da16509a80ee61b17d7bd6232d..0c7f97105add5d36c85c2c5b6bcd6160cbe0d3ca 100644 (file)
@@ -1118,7 +1118,7 @@ static spl_other_handler phar_spl_foreign_handler = {
 PHP_METHOD(Phar, __construct)
 {
 #if !HAVE_SPL
-       zend_throw_exception_ex(zend_exception_ce, 0, "Cannot instantiate Phar object without SPL extension");
+       zend_throw_exception_ex(zend_ce_exception, 0, "Cannot instantiate Phar object without SPL extension");
 #else
        char *fname, *alias = NULL, *error, *arch = NULL, *entry = NULL, *save_fname;
        size_t fname_len, alias_len = 0;
@@ -5295,7 +5295,7 @@ void phar_object_init(void) /* {{{ */
        zend_class_entry ce;
 
        INIT_CLASS_ENTRY(ce, "PharException", phar_exception_methods);
-       phar_ce_PharException = zend_register_internal_class_ex(&ce, zend_exception_ce);
+       phar_ce_PharException = zend_register_internal_class_ex(&ce, zend_ce_exception);
 
 #if HAVE_SPL
        INIT_CLASS_ENTRY(ce, "Phar", php_archive_methods);
index 36fe531612c93630902299608b8298eb41acab1e..463cbd6a3a09e5cd86db9113d25da6d0f2e934fa 100644 (file)
@@ -6572,7 +6572,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
        reflection_object_handlers.write_property = _reflection_write_property;
 
        INIT_CLASS_ENTRY(_reflection_entry, "ReflectionException", reflection_exception_functions);
-       reflection_exception_ptr = zend_register_internal_class_ex(&_reflection_entry, zend_exception_ce);
+       reflection_exception_ptr = zend_register_internal_class_ex(&_reflection_entry, zend_ce_exception);
 
        INIT_CLASS_ENTRY(_reflection_entry, "Reflection", reflection_functions);
        reflection_ptr = zend_register_internal_class(&_reflection_entry);
index aa52c2d9a61b7685e5cc1384fa9e7ecad9298950..a54362fe4b392d253c6bf3f260016d1b8e5a4592 100644 (file)
@@ -2285,7 +2285,7 @@ SXE_METHOD(__construct)
 
        if (!docp) {
                ((php_libxml_node_object *)sxe)->document = NULL;
-               zend_throw_exception(zend_exception_ce, "String could not be parsed as XML", 0);
+               zend_throw_exception(zend_ce_exception, "String could not be parsed as XML", 0);
                return;
        }
 
index 08917ae917092e1c6ca43584e9e09b9341c8962c..92b7732e67679ec319382d8ee391c63f038acd65 100644 (file)
@@ -1820,7 +1820,7 @@ PHP_METHOD(snmp, __construct)
                case SNMP_VERSION_3:
                        break;
                default:
-                       zend_throw_exception(zend_exception_ce, "Unknown SNMP protocol version", 0);
+                       zend_throw_exception(zend_ce_exception, "Unknown SNMP protocol version", 0);
                        return;
        }
 
@@ -2419,7 +2419,7 @@ PHP_MINIT_FUNCTION(snmp)
 #ifdef HAVE_SPL
        php_snmp_exception_ce = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException);
 #else
-       php_snmp_exception_ce = zend_register_internal_class_ex(&cex, zend_exception_ce);
+       php_snmp_exception_ce = zend_register_internal_class_ex(&cex, zend_ce_exception);
 #endif
 
        return SUCCESS;
index ad9f6774b7deb5c00a48ecf42492455b4fe4d4bd..4142ed9915de7db56c3c84047e4950ab250782bb 100644 (file)
@@ -683,7 +683,7 @@ PHP_MINIT_FUNCTION(soap)
 
        /* Register SoapFault class */
        INIT_CLASS_ENTRY(ce, PHP_SOAP_FAULT_CLASSNAME, soap_fault_functions);
-       soap_fault_class_entry = zend_register_internal_class_ex(&ce, zend_exception_ce);
+       soap_fault_class_entry = zend_register_internal_class_ex(&ce, zend_ce_exception);
 
        /* Register SoapParam class */
        INIT_CLASS_ENTRY(ce, PHP_SOAP_PARAM_CLASSNAME, soap_param_functions);
@@ -1495,10 +1495,10 @@ static void _soap_server_exception(soapServicePtr service, sdlFunctionPtr functi
        ZVAL_OBJ(&exception_object, EG(exception));
        if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry)) {
                soap_server_fault_ex(function, &exception_object, NULL);
-       } else if (instanceof_function(Z_OBJCE(exception_object), zend_error_ce)) {
+       } else if (instanceof_function(Z_OBJCE(exception_object), zend_ce_error)) {
                if (service->send_errors) {
                        zval rv;
-                       zend_string *msg = zval_get_string(zend_read_property(zend_error_ce, &exception_object, "message", sizeof("message")-1, 0, &rv));
+                       zend_string *msg = zval_get_string(zend_read_property(zend_ce_error, &exception_object, "message", sizeof("message")-1, 0, &rv));
                        add_soap_fault_ex(&exception_object, this_ptr, "Server", ZSTR_VAL(msg), NULL, NULL);
                        zend_string_release(msg);
                } else {
@@ -2582,13 +2582,13 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
                        add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() failed", NULL, NULL);
                        ret = FALSE;
                } else if (Z_TYPE_P(response) != IS_STRING) {
-                       if (EG(exception) && instanceof_function(EG(exception)->ce, zend_error_ce)) {
+                       if (EG(exception) && instanceof_function(EG(exception)->ce, zend_ce_error)) {
                                zval rv;
                                zend_string *msg;
                                zval exception_object;
 
                                ZVAL_OBJ(&exception_object, EG(exception));
-                               msg = zval_get_string(zend_read_property(zend_error_ce, &exception_object, "message", sizeof("message")-1, 0, &rv));
+                               msg = zval_get_string(zend_read_property(zend_ce_error, &exception_object, "message", sizeof("message")-1, 0, &rv));
                                /* change class */
                                EG(exception)->ce = soap_fault_class_entry;
                                set_soap_fault(&exception_object, NULL, "Client", ZSTR_VAL(msg), NULL, NULL, NULL);
@@ -3280,7 +3280,7 @@ static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, cha
        }
 
        add_property_string(obj, "faultstring", fault_string ? fault_string : "");
-       zend_update_property_string(zend_exception_ce, obj, "message", sizeof("message")-1, (fault_string ? fault_string : ""));
+       zend_update_property_string(zend_ce_exception, obj, "message", sizeof("message")-1, (fault_string ? fault_string : ""));
 
        if (fault_code != NULL) {
                int soap_version = SOAP_GLOBAL(soap_version);
index e6c5eb6efc8c05ecaf2aa16dce0124e200a7551f..b9bf06609af84c6d0e7b1e80d97159d620dda709 100644 (file)
@@ -47,7 +47,7 @@ PHPAPI zend_class_entry *spl_ce_RangeException;
 PHPAPI zend_class_entry *spl_ce_UnderflowException;
 PHPAPI zend_class_entry *spl_ce_UnexpectedValueException;
 
-#define spl_ce_Exception zend_exception_ce
+#define spl_ce_Exception zend_ce_exception
 
 /* {{{ PHP_MINIT_FUNCTION(spl_exceptions) */
 PHP_MINIT_FUNCTION(spl_exceptions)
index 42ce4ce94f5584287da569973eb98c50fef3bf66..eacd66399e0c7286d0730c0e78f25d6350463766 100644 (file)
@@ -54,7 +54,7 @@ static void php_sqlite3_error(php_sqlite3_db_object *db_obj, char *format, ...)
        va_end(arg);
 
        if (db_obj && db_obj->exception) {
-               zend_throw_exception(zend_exception_ce, message, 0);
+               zend_throw_exception(zend_ce_exception, message, 0);
        } else {
                php_error_docref(NULL, E_WARNING, "%s", message);
        }
@@ -111,7 +111,7 @@ PHP_METHOD(sqlite3, open)
        }
 
        if (db_obj->initialised) {
-               zend_throw_exception(zend_exception_ce, "Already initialised DB Object", 0);
+               zend_throw_exception(zend_ce_exception, "Already initialised DB Object", 0);
        }
 
        if (strlen(filename) != filename_len) {
@@ -119,20 +119,20 @@ PHP_METHOD(sqlite3, open)
        }
        if (memcmp(filename, ":memory:", sizeof(":memory:")) != 0) {
                if (!(fullpath = expand_filepath(filename, NULL))) {
-                       zend_throw_exception(zend_exception_ce, "Unable to expand filepath", 0);
+                       zend_throw_exception(zend_ce_exception, "Unable to expand filepath", 0);
                        return;
                }
 
 #if PHP_API_VERSION < 20100412
                if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
-                       zend_throw_exception_ex(zend_exception_ce, 0, "safe_mode prohibits opening %s", fullpath);
+                       zend_throw_exception_ex(zend_ce_exception, 0, "safe_mode prohibits opening %s", fullpath);
                        efree(fullpath);
                        return;
                }
 #endif
 
                if (php_check_open_basedir(fullpath)) {
-                       zend_throw_exception_ex(zend_exception_ce, 0, "open_basedir prohibits opening %s", fullpath);
+                       zend_throw_exception_ex(zend_ce_exception, 0, "open_basedir prohibits opening %s", fullpath);
                        efree(fullpath);
                        return;
                }
@@ -145,7 +145,7 @@ PHP_METHOD(sqlite3, open)
 #else
        if (sqlite3_open(fullpath, &(db_obj->db)) != SQLITE_OK) {
 #endif
-               zend_throw_exception_ex(zend_exception_ce, 0, "Unable to open database: %s", sqlite3_errmsg(db_obj->db));
+               zend_throw_exception_ex(zend_ce_exception, 0, "Unable to open database: %s", sqlite3_errmsg(db_obj->db));
                if (fullpath) {
                        efree(fullpath);
                }
@@ -155,7 +155,7 @@ PHP_METHOD(sqlite3, open)
 #if SQLITE_HAS_CODEC
        if (encryption_key_len > 0) {
                if (sqlite3_key(db_obj->db, encryption_key, encryption_key_len) != SQLITE_OK) {
-                       zend_throw_exception_ex(zend_exception_ce, 0, "Unable to open database: %s", sqlite3_errmsg(db_obj->db));
+                       zend_throw_exception_ex(zend_ce_exception, 0, "Unable to open database: %s", sqlite3_errmsg(db_obj->db));
                        return;
                }
        }
@@ -1807,7 +1807,7 @@ PHP_METHOD(sqlite3result, finalize)
    __constructor for SQLite3Result. */
 PHP_METHOD(sqlite3result, __construct)
 {
-       zend_throw_exception(zend_exception_ce, "SQLite3Result cannot be directly instantiated", 0);
+       zend_throw_exception(zend_ce_exception, "SQLite3Result cannot be directly instantiated", 0);
 }
 /* }}} */
 
index 95437f578b524551cd4d15cb220681a557423256..162b58ae25ae50704671a7ed20d24e6f9da57828 100644 (file)
@@ -114,7 +114,7 @@ PHP_MINIT_FUNCTION(assert) /* {{{ */
        REGISTER_LONG_CONSTANT("ASSERT_EXCEPTION", ASSERT_EXCEPTION, CONST_CS|CONST_PERSISTENT);
 
        INIT_CLASS_ENTRY(ce, "AssertionError", NULL);
-       assertion_error_ce = zend_register_internal_class_ex(&ce, zend_error_ce);
+       assertion_error_ce = zend_register_internal_class_ex(&ce, zend_ce_error);
 
        return SUCCESS;
 }
index c1bfc74d997b43a792baf5c81342cdc418e82b0d..3b2bed8538a15b3899138968ed4a92ccea7124b0 100644 (file)
@@ -1090,7 +1090,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
                                                zval tmp, *msg, rv;
 
                                                ZVAL_OBJ(&tmp, EG(exception));
-                                               msg = zend_read_property(zend_exception_ce, &tmp, "message", sizeof("message")-1, 0, &rv);
+                                               msg = zend_read_property(zend_ce_exception, &tmp, "message", sizeof("message")-1, 0, &rv);
                                                zend_printf("Exception: %s\n", Z_STRVAL_P(msg));
                                                zval_ptr_dtor(&tmp);
                                                EG(exception) = NULL;