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 for Scripting Engine problem Bug #52563

Patch version 2010-08-27 10:41 UTC

Return to Bug #52563 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions: 2010-08-27 10:41 UTC | 2010-08-09 10:46 UTC

Developer: aharvey@php.net

Line 1 (now 1), was 32 lines, now 23 lines
 Index: Zend/zend_constants.c
 ===================================================================
 --- Zend/zend_constants.c	(revision 302013)
 +++ Zend/zend_constants.c	(working copy)
 @@ -97,6 +97,7 @@
 diff --git a/UPGRADING b/UPGRADING
 index a0d86d0..7a37a99 100755
 --- a/UPGRADING
 +++ b/UPGRADING
 @@ -234,7 +234,8 @@ UPGRADE NOTES - PHP X.Y
   
  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);
 Index: Zend/zend_errors.h
 ===================================================================
 --- Zend/zend_errors.h	(revision 302013)
 +++ 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)
 Index: Zend/tests/bug52563.phpt
 ===================================================================
 --- Zend/tests/bug52563.phpt	(revision 0)
 +++ Zend/tests/bug52563.phpt	(revision 0)
       f. New global constants
  
 -       - 
 +       - Core:
 +         - E_NONE
  
       g. New classes
  
 diff --git a/Zend/tests/bug52563.phpt b/Zend/tests/bug52563.phpt
 new file mode 100644
 index 0000000..97dbf20
 --- /dev/null
 +++ b/Zend/tests/bug52563.phpt
  @@ -0,0 +1,18 @@
  +--TEST--
  +Bug #52563 (error_reporting constant)
  +--FILE--


  +var_dump(defined('E_NONE'));
  +var_dump(E_NONE);
  +
  +error_reporting(E_ALL);
 +trigger_error('Test error', E_USER_WARNING);
 +
 +trigger_error('Test error', E_USER_WARNING);
 +
  +error_reporting(E_NONE);
  +trigger_error('Test error', E_USER_WARNING);
  +?>
  +--EXPECTF--
  +bool(true)
  +int(0)
  +
  +Warning: Test error in %s on line %d
 diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c
 index ed00b99..1a766a0 100644
 --- a/Zend/zend_constants.c
 +++ b/Zend/zend_constants.c
 @@ -97,6 +97,7 @@ int zend_startup_constants(TSRMLS_D)
  
  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);
 diff --git a/Zend/zend_errors.h b/Zend/zend_errors.h
 index 739c8d4..c8f72a1 100644
 --- a/Zend/zend_errors.h
 +++ b/Zend/zend_errors.h
 @@ -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)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 00:01:28 2024 UTC