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-09 10:46 UTC

Return to Bug #52563 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: aharvey@php.net

Index: Zend/zend_constants.c
===================================================================
--- Zend/zend_constants.c	(revision 302013)
+++ 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);
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)
@@ -0,0 +1,18 @@
+--TEST--
+Bug #52563 (error_reporting constant)
+--FILE--
+<?php
+var_dump(defined('E_NONE'));
+var_dump(E_NONE);
+
+error_reporting(E_ALL);
+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
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 01:01:30 2024 UTC