-#define HE_NOTICE (HTTP_G(only_exceptions) ? E_THROW : E_NOTICE)
-#define HE_WARNING (HTTP_G(only_exceptions) ? E_THROW : E_WARNING)
-#define HE_ERROR (HTTP_G(only_exceptions) ? E_THROW : E_ERROR)
+#ifdef ZEND_ENGINE_2
+# define HE_NOTICE (HTTP_G(only_exceptions) ? E_THROW : E_NOTICE)
+# define HE_WARNING (HTTP_G(only_exceptions) ? E_THROW : E_WARNING)
+# define HE_ERROR (HTTP_G(only_exceptions) ? E_THROW : E_ERROR)
+#else
+# define HE_NOTICE E_NOTICE
+# define HE_WARNING E_WARNING
+# define HE_ERROR E_ERROR
+#endif