]> granicus.if.org Git - php/commitdiff
MFH: Add E_USER_DEPRECATED (patch by Lars Strojny)
authorHannes Magnusson <bjori@php.net>
Mon, 21 Jul 2008 09:41:00 +0000 (09:41 +0000)
committerHannes Magnusson <bjori@php.net>
Mon, 21 Jul 2008 09:41:00 +0000 (09:41 +0000)
NEWS
Zend/tests/015.phpt
Zend/zend.c
Zend/zend_builtin_functions.c
Zend/zend_constants.c
Zend/zend_errors.h
main/main.c
php.ini-dist
php.ini-recommended
run-tests.php

diff --git a/NEWS b/NEWS
index 91b261e99cf7cc543d2598ad8b20307b06f7b0ce..5701f8956e20c54de92b633729649c1b240420ec 100644 (file)
--- a/NEWS
+++ b/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)
index b8b2338861507f950285795ccbefbf9298dfdaa9..ffe1a4f94e831bcf5994608bc4941220bf98b0fe 100644 (file)
@@ -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
index 42e8efd9b17fdb85f2bc8d79a94ee4670608ddd3..0e35dd40cc4f8b26c26862432999580fa81ff9c2 100644 (file)
@@ -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);
index 5beb2294264b83751d8ffe8507ccb2256d027131..56806460922a1a8e5305e9028eee8ed5adbd1424 100644 (file)
@@ -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");
index 3ca4a29e8c235ab69a5a8f8941efe7f3bacc18c4..c672b5e4c6bfc0e56fb052156a95c97a2a2d5041 100644 (file)
@@ -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);
 
index 1f5d0e74bb07d3e00f6bec653e9d1f0df690890a..708a2dce00ee80f6fc06a066a01ae490a34862e7 100644 (file)
@@ -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 */
index ea7ed5d83712ef9749f026fba1c2358961002e89..2501a98418bae62db95050e37d1646203e21aa9e 100644 (file)
@@ -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:
index 89f773ccabe122fab26eaee485ffada2a633400e..a744e56de8ff23afefb5e1f595abda83370a85be 100644 (file)
@@ -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:
 ;
index ce9f532a63e1efd4fd466c3972ff232cfd070718..2c531c7664a3c49a5ea6357cce36bbdb6c55491d 100644 (file)
@@ -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:
 ;
index 4110f7ceb88eafb79c324926d680bd0052dcace4..e406b66f70643063d627404eda3ac4d9d0563ecd 100755 (executable)
@@ -177,7 +177,7 @@ $ini_overwrites = array(
                'safe_mode=0',
                'disable_functions=',
                'output_buffering=Off',
-               'error_reporting=16383',
+               'error_reporting=30719',
                'display_errors=1',
                'display_startup_errors=1',
                'log_errors=0',