php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #52563
Patch E_ALL revision 2010-08-27 10:52 UTC by aharvey@php.net
Patch E_NONE revision 2010-08-27 10:41 UTC by aharvey@php.net
revision 2010-08-09 10:46 UTC by aharvey@php.net
Patch E_NONE-and-E_EVERYTHING revision 2010-08-10 03:00 UTC by aharvey@php.net

Patch E_NONE-and-E_EVERYTHING for Scripting Engine problem Bug #52563

Patch version 2010-08-10 03:00 UTC

Return to Bug #52563 | Download this patch
Patch Revisions:

Developer: aharvey@php.net

Index: Zend/zend_constants.c
===================================================================
--- Zend/zend_constants.c	(revision 302055)
+++ Zend/zend_constants.c	(working copy)
@@ -97,6 +97,7 @@
 
 void zend_register_standard_constants(TSRMLS_D)
 {
+	REGISTER_MAIN_LONG_CONSTANT("E_NONE", E_NONE, CONST_PERSISTENT | CONST_CS);
 	REGISTER_MAIN_LONG_CONSTANT("E_ERROR", E_ERROR, CONST_PERSISTENT | CONST_CS);
 	REGISTER_MAIN_LONG_CONSTANT("E_RECOVERABLE_ERROR", E_RECOVERABLE_ERROR, CONST_PERSISTENT | CONST_CS);
 	REGISTER_MAIN_LONG_CONSTANT("E_WARNING", E_WARNING, CONST_PERSISTENT | CONST_CS);
@@ -114,6 +115,7 @@
 	REGISTER_MAIN_LONG_CONSTANT("E_USER_DEPRECATED", E_USER_DEPRECATED, CONST_PERSISTENT | CONST_CS);
 
 	REGISTER_MAIN_LONG_CONSTANT("E_ALL", E_ALL, CONST_PERSISTENT | CONST_CS);
+	REGISTER_MAIN_LONG_CONSTANT("E_EVERYTHING", E_EVERYTHING, CONST_PERSISTENT | CONST_CS);
 
 	/* true/false constants */
 	{
Index: Zend/zend_errors.h
===================================================================
--- Zend/zend_errors.h	(revision 302055)
+++ Zend/zend_errors.h	(working copy)
@@ -22,6 +22,7 @@
 #ifndef ZEND_ERRORS_H
 #define ZEND_ERRORS_H
 
+#define E_NONE				0
 #define E_ERROR				(1<<0L)
 #define E_WARNING			(1<<1L)
 #define E_PARSE				(1<<2L)
@@ -40,6 +41,7 @@
 
 #define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED)
 #define E_CORE (E_CORE_ERROR | E_CORE_WARNING)
+#define E_EVERYTHING		-1
 
 #endif /* ZEND_ERRORS_H */
 
Index: Zend/tests/bug52563.phpt
===================================================================
--- Zend/tests/bug52563.phpt	(revision 0)
+++ Zend/tests/bug52563.phpt	(revision 0)
@@ -0,0 +1,43 @@
+--TEST--
+Bug #52563 (error_reporting constant)
+--FILE--
+<?php
+class C {
+    public function f() {
+    }
+}
+
+function generate_strict() {
+    C::f();
+}
+
+
+var_dump(defined('E_NONE'));
+var_dump(E_NONE);
+
+var_dump(defined('E_EVERYTHING'));
+var_dump(E_EVERYTHING);
+
+error_reporting(E_ALL);
+trigger_error('Test warning with E_ALL', E_USER_WARNING);
+generate_strict();
+
+error_reporting(E_NONE);
+trigger_error('Test warning with E_NONE', E_USER_WARNING);
+generate_strict();
+
+error_reporting(E_EVERYTHING);
+trigger_error('Test warning with E_EVERYTHING', E_USER_WARNING);
+generate_strict();
+?>
+--EXPECTF--
+bool(true)
+int(0)
+bool(true)
+int(-1)
+
+Warning: Test warning with E_ALL in %s on line %d
+
+Warning: Test warning with E_EVERYTHING in %s on line %d
+
+Strict Standards: Non-static method C::f() should not be called statically in %s on line %d
Index: UPGRADING
===================================================================
--- UPGRADING	(revision 302055)
+++ UPGRADING	(working copy)
@@ -233,7 +233,9 @@
 
      f. New global constants
 
-       - 
+       - Core:
+         - E_EVERYTHING
+         - E_NONE
 
      g. New classes
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 01:01:28 2024 UTC