]> granicus.if.org Git - php/commitdiff
Remove EH_SUPPRESS mode
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 23 Dec 2017 12:25:26 +0000 (13:25 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 23 Dec 2017 12:28:09 +0000 (13:28 +0100)
It is unused and does not work in any meaningful way:
Warnings are suppressed, but everything else (both notices and
fatals) are not. It would make some sense if it suppressed
warnings and lower, but right now this is a pointless mode.

Zend/zend.h
main/main.c

index cf6bd37d5d8ac73ad9a9786a3f2688996294ac9b..340e2867ca7d7589a5aba5a5fa6e9f112a4a3b4b 100644 (file)
@@ -313,7 +313,6 @@ END_EXTERN_C()
 
 typedef enum {
        EH_NORMAL = 0,
-       EH_SUPPRESS,
        EH_THROW
 } zend_error_handling_t;
 
index 8842f8f86f240e508f4a45c7f60098a237b152c3..7dd65253ed3d30f1d31e26496227208787dd1ba5 100644 (file)
@@ -1074,8 +1074,8 @@ static ZEND_COLD void php_error_cb(int type, const char *error_filename, const u
                PG(last_error_lineno) = error_lineno;
        }
 
-       /* according to error handling mode, suppress error, throw exception or show it */
-       if (EG(error_handling) != EH_NORMAL) {
+       /* according to error handling mode, throw exception or show it */
+       if (EG(error_handling) == EH_THROW) {
                switch (type) {
                        case E_ERROR:
                        case E_CORE_ERROR:
@@ -1097,7 +1097,7 @@ static ZEND_COLD void php_error_cb(int type, const char *error_filename, const u
                                /* throw an exception if we are in EH_THROW mode
                                 * but DO NOT overwrite a pending exception
                                 */
-                               if (EG(error_handling) == EH_THROW && !EG(exception)) {
+                               if (!EG(exception)) {
                                        zend_throw_error_exception(EG(exception_class), buffer, 0, type);
                                }
                                efree(buffer);