Permalink
Browse files

MFH: Add E_USER_DEPRECATED (patch by Lars Strojny)

  • Loading branch information...
1 parent 4fb0cec commit d619b57efa42c81eb4632d1794747f074cc3fb91 @bjori bjori committed Jul 21, 2008
Showing with 16 additions and 4 deletions.
  1. +2 −2 NEWS
  2. +4 −0 Zend/tests/015.phpt
  3. +1 −0 Zend/zend.c
  4. +1 −0 Zend/zend_builtin_functions.c
  5. +1 −0 Zend/zend_constants.c
  6. +2 −1 Zend/zend_errors.h
  7. +2 −0 main/main.c
  8. +1 −0 php.ini-dist
  9. +1 −0 php.ini-recommended
  10. +1 −1 run-tests.php
View
4 NEWS
@@ -33,8 +33,8 @@ PHP NEWS
. Added __DIR__ constant. (Lars Strojny)
. Added PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION,
PHP_EXTRA_VERSION, PHP_VERSION_ID, PHP_ZTS and PHP_DEBUG constants. (Pierre)
- . Added new error mode E_DEPRECATED which is used to inform about stuff to be
- dropped in future PHP versions. (Lars Strojny, Felipe, Marcus)
+ . Added new error modes E_USER_DEPRECATED and E_DEPRECATED which is used to inform
+ about stuff to be dropped in future PHP versions. (Lars Strojny, Felipe, Marcus)
. Added "request_order" INI variable to control specifically $_REQUEST behavior.
(Stas)
. Added support for exception linking. (Marcus)
View
@@ -9,6 +9,7 @@ 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";
?>
@@ -30,4 +31,7 @@ bool(false)
Warning: error in %s on line %d
bool(true)
+
+Deprecated: error in %s on line %d
+bool(true)
Done
View
@@ -1000,6 +1000,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);
@@ -1479,6 +1479,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");
View
@@ -109,6 +109,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);
View
@@ -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_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_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED)
#define E_CORE (E_CORE_ERROR | E_CORE_WARNING)
#endif /* ZEND_ERRORS_H */
View
@@ -844,6 +844,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:
@@ -894,6 +895,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:
View
@@ -295,6 +295,7 @@ memory_limit = 128M ; Maximum amount of memory a script may consume (128MB)
; 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:
;
View
@@ -344,6 +344,7 @@ memory_limit = 128M ; Maximum amount of memory a script may consume (128MB)
; 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:
;
View
@@ -177,7 +177,7 @@ function verify_config()
'safe_mode=0',
'disable_functions=',
'output_buffering=Off',
- 'error_reporting=16383',
+ 'error_reporting=30719',
'display_errors=1',
'display_startup_errors=1',
'log_errors=0',

0 comments on commit d619b57

Please sign in to comment.