mirror of
https://github.com/php/php-src.git
synced 2025-08-20 09:24:05 +02:00
Add E_USER_DEPRECATED (patch by Lars Strojny)
This commit is contained in:
parent
637e591a3d
commit
5919165375
9 changed files with 18 additions and 8 deletions
|
@ -9,20 +9,19 @@ var_dump(trigger_error(array()));
|
|||
var_dump(trigger_error("error", -1));
|
||||
var_dump(trigger_error("error", 0));
|
||||
var_dump(trigger_error("error", E_USER_WARNING));
|
||||
var_dump(trigger_error("error", E_USER_DEPRECATED));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for trigger_error() in %s on line %d
|
||||
--EXPECTF--
|
||||
Warning: trigger_error() expects at least 1 parameter, 0 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Notice: error in %s on line %d
|
||||
bool(true)
|
||||
|
||||
Notice: Array to string conversion in %s on line %d
|
||||
|
||||
Notice: Array in %s on line %d
|
||||
bool(true)
|
||||
Warning: trigger_error() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Invalid error type specified in %s on line %d
|
||||
bool(false)
|
||||
|
@ -32,4 +31,7 @@ bool(false)
|
|||
|
||||
Warning: error in %s on line %d
|
||||
bool(true)
|
||||
|
||||
Deprecated: error in %s on line %d
|
||||
bool(true)
|
||||
Done
|
||||
|
|
|
@ -1521,6 +1521,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
|||
case E_USER_ERROR:
|
||||
case E_USER_WARNING:
|
||||
case E_USER_NOTICE:
|
||||
case E_USER_DEPRECATED:
|
||||
case E_RECOVERABLE_ERROR:
|
||||
if (zend_is_compiling(TSRMLS_C)) {
|
||||
error_filename = zend_get_compiled_filename(TSRMLS_C);
|
||||
|
|
|
@ -1480,6 +1480,7 @@ ZEND_FUNCTION(trigger_error)
|
|||
case E_USER_ERROR:
|
||||
case E_USER_WARNING:
|
||||
case E_USER_NOTICE:
|
||||
case E_USER_DEPRECATED:
|
||||
break;
|
||||
default:
|
||||
zend_error(E_WARNING, "Invalid error type specified");
|
||||
|
|
|
@ -112,6 +112,7 @@ void zend_register_standard_constants(TSRMLS_D) /* {{{ */
|
|||
REGISTER_MAIN_LONG_CONSTANT("E_USER_ERROR", E_USER_ERROR, CONST_PERSISTENT | CONST_CS);
|
||||
REGISTER_MAIN_LONG_CONSTANT("E_USER_WARNING", E_USER_WARNING, CONST_PERSISTENT | CONST_CS);
|
||||
REGISTER_MAIN_LONG_CONSTANT("E_USER_NOTICE", E_USER_NOTICE, CONST_PERSISTENT | CONST_CS);
|
||||
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);
|
||||
|
||||
|
|
|
@ -36,8 +36,9 @@
|
|||
#define E_STRICT (1<<11L)
|
||||
#define E_RECOVERABLE_ERROR (1<<12L)
|
||||
#define E_DEPRECATED (1<<13L)
|
||||
#define E_USER_DEPRECATED (1<<14L)
|
||||
|
||||
#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_STRICT | E_RECOVERABLE_ERROR | E_DEPRECATED)
|
||||
#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_STRICT | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED)
|
||||
#define E_CORE (E_CORE_ERROR | E_CORE_WARNING)
|
||||
|
||||
#endif /* ZEND_ERRORS_H */
|
||||
|
|
|
@ -944,6 +944,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
|
|||
break;
|
||||
case E_STRICT:
|
||||
case E_DEPRECATED:
|
||||
case E_USER_DEPRECATED:
|
||||
/* for the sake of BC to old damaged code */
|
||||
break;
|
||||
case E_NOTICE:
|
||||
|
@ -994,6 +995,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
|
|||
error_type_str = "Strict Standards";
|
||||
break;
|
||||
case E_DEPRECATED:
|
||||
case E_USER_DEPRECATED:
|
||||
error_type_str = "Deprecated";
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -245,6 +245,7 @@ memory_limit = 128M ; Maximum amount of memory a script may consume (128M)
|
|||
; E_USER_NOTICE - user-generated notice message
|
||||
; E_DEPRECATED - warn about code that will not work in future versions
|
||||
; of PHP
|
||||
; E_USER_DEPRECATED - user-generated deprecation warnings
|
||||
;
|
||||
; Examples:
|
||||
;
|
||||
|
|
|
@ -282,6 +282,7 @@ memory_limit = 128M ; Maximum amount of memory a script may consume (128M)
|
|||
; E_USER_NOTICE - user-generated notice message
|
||||
; E_DEPRECATED - warn about code that will not work in future versions
|
||||
; of PHP
|
||||
; E_USER_DEPRECATED - user-generated deprecation warnings
|
||||
;
|
||||
; Examples:
|
||||
;
|
||||
|
|
|
@ -166,7 +166,7 @@ $ini_overwrites = array(
|
|||
'open_basedir=',
|
||||
'disable_functions=',
|
||||
'output_buffering=Off',
|
||||
'error_reporting=16383',
|
||||
'error_reporting=30719',
|
||||
'display_errors=1',
|
||||
'display_startup_errors=1',
|
||||
'log_errors=0',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue