]> granicus.if.org Git - php/commitdiff
Don't silence fatal errors with @
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 26 Nov 2018 20:20:03 +0000 (21:20 +0100)
committerJoe Watkins <krakjoe@php.net>
Thu, 31 Jan 2019 06:11:05 +0000 (07:11 +0100)
50 files changed:
UPGRADING
Zend/tests/bug34786.phpt
Zend/zend_errors.h
Zend/zend_execute.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
ext/standard/tests/array/array_multisort_variation1.phpt
ext/standard/tests/array/array_multisort_variation2.phpt
ext/standard/tests/array/array_multisort_variation3.phpt
ext/standard/tests/file/basename_variation3.phpt
ext/standard/tests/file/basename_variation4.phpt
ext/standard/tests/file/chmod_variation3.phpt
ext/standard/tests/file/chmod_variation4.phpt
ext/standard/tests/file/dirname_variation1.phpt
ext/standard/tests/file/file_get_contents_variation3.phpt
ext/standard/tests/file/file_get_contents_variation4.phpt
ext/standard/tests/file/file_get_contents_variation5_64bit.phpt
ext/standard/tests/file/file_get_contents_variation6.phpt
ext/standard/tests/file/file_put_contents_variation2.phpt
ext/standard/tests/file/file_put_contents_variation3.phpt
ext/standard/tests/file/file_variation2.phpt
ext/standard/tests/file/file_variation3.phpt
ext/standard/tests/file/file_variation4.phpt
ext/standard/tests/file/fopen_variation3.phpt
ext/standard/tests/file/fopen_variation4.phpt
ext/standard/tests/file/fwrite_variation5.phpt
ext/standard/tests/file/mkdir_variation1.phpt
ext/standard/tests/file/mkdir_variation2.phpt
ext/standard/tests/file/mkdir_variation3.phpt
ext/standard/tests/file/mkdir_variation4.phpt
ext/standard/tests/file/parse_ini_file_variation4.phpt
ext/standard/tests/file/parse_ini_file_variation5.phpt
ext/standard/tests/file/pathinfo_variation1.phpt
ext/standard/tests/file/pathinfo_variation2.phpt
ext/standard/tests/file/pclose_variation1.phpt
ext/standard/tests/file/readfile_variation4.phpt
ext/standard/tests/file/readfile_variation5.phpt
ext/standard/tests/file/rename_variation10.phpt
ext/standard/tests/file/rmdir_variation1.phpt
ext/standard/tests/file/rmdir_variation2.phpt
ext/standard/tests/file/touch_variation3.phpt
ext/standard/tests/file/touch_variation4.phpt
ext/standard/tests/file/umask_variation3.phpt
ext/standard/tests/file/unlink_variation7.phpt
ext/standard/tests/general_functions/call_user_func_array_variation_002.phpt
ext/standard/tests/general_functions/call_user_func_array_variation_003.phpt
ext/standard/tests/general_functions/intval_variation1.phpt
ext/standard/tests/network/ip2long_variation1.phpt
ext/standard/tests/network/long2ip_variation1.phpt
tests/output/ob_implicit_flush_variation_001.phpt

index c735b4d521a422ec661c0dae6a1e7a111d2484e1..a063b91fdbe8cc54a96d99eedaaa60f797833790 100644 (file)
--- a/UPGRADING
+++ b/UPGRADING
@@ -25,6 +25,10 @@ PHP 7.4 UPGRADE NOTES
   . Referencing parent:: inside a class that does not have a parent will now
     generate a compile-time error. Previously the error was only emitted at
     run-time.
+  . Supressing errors of type E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR,
+    E_USER_ERROR, E_RECOVERABLE_ERROR, E_PARSE with the @ operator is no
+    longer supported. They may still be suppressed with error_reporting
+    or configuration.
 
 - Curl:
   . Attempting to serialize a CURLFile class will now generate an exception.
index 18642848d8424e160494bccb9f11bea578afae78..ef0627633fcdabb0155882efd86e33ee53c7b756 100644 (file)
@@ -10,13 +10,13 @@ function bar() {
 echo "bar: ".error_reporting()."\n";
 }
 
-error_reporting(1);
+error_reporting(E_WARNING);
 echo "before: ".error_reporting()."\n";
 @foo(1,@bar(),3);
 echo "after: ".error_reporting()."\n";
 ?>
 --EXPECT--
-before: 1
+before: 2
 bar: 0
 foo: 0
-after: 1
+after: 2
index 9932b1e47efa9ade4b85b1868ff9126d920cec20..ac48ef60ad051368776b9f59d53e9d5855fa96cb 100644 (file)
 #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 | E_STRICT)
 #define E_CORE (E_CORE_ERROR | E_CORE_WARNING)
 
+/* Fatal errors that are ignored by the silence operator */
+#define E_FATAL_ERRORS (E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR | E_PARSE)
+
+#define E_HAS_ONLY_FATAL_ERRORS(mask) !((mask) & ~E_FATAL_ERRORS)
+
 #endif /* ZEND_ERRORS_H */
 
 /*
index 2b832b6f0dcdc5dc859fcb49feee20c36f39fedc..03c621f08f2ab5f3781a8e01238f3f7c1b2707af 100644 (file)
@@ -3755,7 +3755,8 @@ static void cleanup_live_vars(zend_execute_data *execute_data, uint32_t op_num,
                                        }
                                } else if (kind == ZEND_LIVE_SILENCE) {
                                        /* restore previous error_reporting value */
-                                       if (!EG(error_reporting) && Z_LVAL_P(var) != 0) {
+                                       if (E_HAS_ONLY_FATAL_ERRORS(EG(error_reporting))
+                                                       && !E_HAS_ONLY_FATAL_ERRORS(Z_LVAL_P(var))) {
                                                EG(error_reporting) = Z_LVAL_P(var);
                                        }
                                }
index 060c4bf6fe4b01f423b51706705794429d332558..8d6c972b9c9970581a3460eb7682a050991caf57 100644 (file)
@@ -6690,9 +6690,10 @@ ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY)
 
        ZVAL_LONG(EX_VAR(opline->result.var), EG(error_reporting));
 
-       if (EG(error_reporting)) {
+       if (!E_HAS_ONLY_FATAL_ERRORS(EG(error_reporting))) {
                do {
-                       EG(error_reporting) = 0;
+                       /* Do not silence fatal errors */
+                       EG(error_reporting) &= E_FATAL_ERRORS;
                        if (!EG(error_reporting_ini_entry)) {
                                zval *zv = zend_hash_find_ex(EG(ini_directives), ZSTR_KNOWN(ZEND_STR_ERROR_REPORTING), 1);
                                if (zv) {
@@ -6721,7 +6722,8 @@ ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY)
 {
        USE_OPLINE
 
-       if (!EG(error_reporting) && Z_LVAL_P(EX_VAR(opline->op1.var)) != 0) {
+       if (E_HAS_ONLY_FATAL_ERRORS(EG(error_reporting))
+                       && !E_HAS_ONLY_FATAL_ERRORS(Z_LVAL_P(EX_VAR(opline->op1.var)))) {
                EG(error_reporting) = Z_LVAL_P(EX_VAR(opline->op1.var));
        }
        ZEND_VM_NEXT_OPCODE();
index d8258c9783fd837a872b0cb8fd80f188259cf693..7e9ef62effbb017ab3cab22aaada0b8131d00436 100644 (file)
@@ -1523,9 +1523,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEN
 
        ZVAL_LONG(EX_VAR(opline->result.var), EG(error_reporting));
 
-       if (EG(error_reporting)) {
+       if (!E_HAS_ONLY_FATAL_ERRORS(EG(error_reporting))) {
                do {
-                       EG(error_reporting) = 0;
+                       /* Do not silence fatal errors */
+                       EG(error_reporting) &= E_FATAL_ERRORS;
                        if (!EG(error_reporting_ini_entry)) {
                                zval *zv = zend_hash_find_ex(EG(ini_directives), ZSTR_KNOWN(ZEND_STR_ERROR_REPORTING), 1);
                                if (zv) {
@@ -19504,7 +19505,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_END_SILENCE_SPEC_TMP_HANDLER(Z
 {
        USE_OPLINE
 
-       if (!EG(error_reporting) && Z_LVAL_P(EX_VAR(opline->op1.var)) != 0) {
+       if (E_HAS_ONLY_FATAL_ERRORS(EG(error_reporting))
+                       && !E_HAS_ONLY_FATAL_ERRORS(Z_LVAL_P(EX_VAR(opline->op1.var)))) {
                EG(error_reporting) = Z_LVAL_P(EX_VAR(opline->op1.var));
        }
        ZEND_VM_NEXT_OPCODE();
index 9a33a270f1d8350767aea6f2da63af3f793fe5d1..f8d012b395718b03e207a4602fe80955d153c756 100644 (file)
@@ -12,7 +12,7 @@ echo "*** Testing array_multisort() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 8c26a8347be07ae834bd3b0374336aa58047ba71..ca5c08940c0e47d7d73ca840c839e1733be178b9 100644 (file)
@@ -12,7 +12,7 @@ echo "*** Testing array_multisort() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 28130e31fd2232fbbea42880b1551b32ac1a9501..a13755e4059b0227c761bbd5c1e97acc7184c92d 100644 (file)
@@ -12,7 +12,7 @@ echo "*** Testing array_multisort() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 684e538d76893e4031898b575e540c23745b2928..ee3395bc84172e30f964f7a59a6895270bd61e03 100644 (file)
@@ -12,7 +12,7 @@ echo "*** Testing basename() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 2bb94870dfea940c20779a90adeb6d06155d42ac..12852a326111b1d7d0157e605e135a2cd9a6f92b 100644 (file)
@@ -12,7 +12,7 @@ echo "*** Testing basename() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index bc6f0dc8600d3bced0eedd5f6b181ce564a094d7..dcb7fc3bbb6df3d65d64f51165bf44aadbe8c389 100644 (file)
@@ -12,7 +12,7 @@ echo "*** Testing chmod() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index e0da9f66ee37ca52d92648b9742e5d771f53954e..cd04e4892820c3630348d2c7d05f2fe7ab3739e6 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing chmod() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 5e97982a9a696082359afb999c8a291b72839436..339f63b9f48eecb5ffdd755cf9980b80a8919e66 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing dirname() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 9e8de27f3f8ad0e0e75d439d8f98118af094d34a..81413b1fcd93dbc66e2ba0ddde67c8c50ac9f237 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing file_get_contents() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 0ca7a6bf20a0e1b409dd3b3c6bf0a35ef81424b3..041d81220fb7b3ee09cb6f6b413f3dbd98df59a9 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing file_get_contents() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index d0b74757d20d6f64e2bda6eb3abbd83acf20b852..104ad6e6d7a5e133ab03606c30be9580d991ab24 100644 (file)
@@ -16,7 +16,7 @@ echo "*** Testing file_get_contents() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index f30cac10d21adedff984c1fcbe0831efcdf1b844..1a547c5fa4da425a1999df92f51536c0ad0c28d8 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing file_get_contents() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index ae56486d5fea9dc53591db0b45941c59270665a6..1d5fd98946513ee9bbcc17f9ca7715fe90d3bd94 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing file_put_contents() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 74130007a72eea4da587f37cb3d6c17dfc7de93d..5808fd37c7999c52faf3aa5f1913dc31fe18e5c1 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing file_put_contents() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 9c3ad0e546ba6fae83f4f2e5f76a8b23932009a2..6f8619d74fc8e6ed1403e58f94733a6023ec6b30 100644 (file)
@@ -12,7 +12,7 @@ echo "*** Testing file() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 014adec6d8d7b762205fa94fae6e5e4e1c8c272c..81348cac9296753009554d5618c4db487dc667be 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing file() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 103c2b0af62728c226b920d57d66a3544a964877..7a8a120223ced3471bc6070ab48a26c48ecec861 100644 (file)
@@ -12,7 +12,7 @@ echo "*** Testing file() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index fb00b243fc680b842aace6e9e48c1bcb08b925be..a714cd7000d6c335ef152c63323e16145548f478 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing fopen() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 15f9e60c5a3f3c62f5b3d35dd4add3353eaf819d..f18d70a630a3312598f5a73d415ec5ad875d6282 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing fopen() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index ff1214c5270d7824c60d901d3ac7f66c20d4bb18..b0151e921d51986471d93212ccaa4b698ad09bb4 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing fwrite() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index c77c66b531292627f4103d70c86c908db86180a1..85ec358b075c94e434484f4deaa501c05414a71b 100644 (file)
@@ -19,7 +19,7 @@ echo "*** Testing mkdir() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 51a1c39c17623475f55ab367e4b63e9cd525b9d5..7ff3774d66d97ff7048bbe205b2acae824822a76 100644 (file)
@@ -16,7 +16,7 @@ echo "*** Testing mkdir() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 4c037b6bcab48d8d971a2d43f18e2f122d709e7a..114d7b0355e27f7f5c49c04ea523cf8886c5b11c 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing mkdir() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index a31ae722c688172a9b0cfd9addb8a936a165f66a..9aedc0c7c9b565c4d907cc5912c641df4b621ee1 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing mkdir() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 15acc9c3c5a563091e513d6639d7138177272727..2c8a80becf32dafa4c3a59bc8336c1768440df60 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing parse_ini_file() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 4cfc2a661f4a17a7334276ed9e93c3df6225abb3..166fa09c8ca3b89f6903b35f0a55b96a51efa0a9 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing parse_ini_file() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 36d9bab5ae3af48a0cedb205bf13106c25fc253a..2170491023c8cf4c4b71d25d4d2f97e5f905d8a1 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing pathinfo() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index a39543b18ff01f2dd35e24f26987b11a2dc8c2b7..265364e48f9925445f672c425eaa3989289127fa 100644 (file)
@@ -16,7 +16,7 @@ echo "*** Testing pathinfo() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 7c22389646ead0b35a8858fa080b72202e38f21c..c328534c65e921fe3388c6557b9dbc2aef9be22d 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing pclose() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 99ee79e40bad79c2a13d1d0c0276fda9a77d14dc..e9378bee904c2ee5f6cfd29ff1ff55801d474370 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing readfile() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index bc9c0640551a29a43453d5ee40e17600cd09dcb0..d8cecbd14c31bbf522d73e88808d26ce7d7b4e8f 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing readfile() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 8ee59168b10982191e9e5b0b8bc5dc43c89f9014..62b156ae01a3f42efa5ebd4ad781207e02ab0100 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing rename() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 0556266efabf622d872515a92810967fa1ab6700..5a802e5d2a552f809abf1e098b081ca53a81654e 100644 (file)
@@ -19,7 +19,7 @@ echo "*** Testing rmdir() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 7555200344b54a3bbba59c38c506942b152e879a..4f57de7c48b259078f801642320d9dabca8fa7ef 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing rmdir() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 5eb6ad315efdf51ab8a1e6c78c4a765269fac5f8..b6c7080a0615158bedddedbfe0fc2821026b9773 100644 (file)
@@ -21,7 +21,7 @@ echo "*** Testing touch() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 190d0f4b1ab937ac53677661a80a96f6a1923d2d..32d48fdb58c44729cd2c7555ff3d373510250044 100644 (file)
@@ -21,7 +21,7 @@ echo "*** Testing touch() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 68996ab69279488c1aaa904f0584dac9b6bdf58f..9f07e09a60d03cdbe5c58983afeac773cf838ab9 100644 (file)
@@ -21,7 +21,7 @@ echo "*** Testing umask() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index b4a6bd5a1f9943dad31976fa2e5440283a8d4e5c..ff83a1d5480172c5e7a43ae0c1dfafaadb195ed0 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing unlink() : usage variation different types for context ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 51a079ad53a0d0790482e272d6df9d2700fab574..d26944c94bb7b53f99abd40d840b3ab6bb84b26b 100644 (file)
@@ -12,7 +12,7 @@ echo "*** Testing call_user_func_array() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index c8c8ce66048016fba464f84e9e2f156ef656a94b..1cc957f6bb586e6901ef7d095bbe8b30a4818e0b 100644 (file)
@@ -12,7 +12,7 @@ echo "*** Testing call_user_func_array() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index e76d7083d4d2832b645718b255a64e4f41c09d22..65592fa4ad6d20f56d4995a36467139a610633d8 100644 (file)
@@ -12,7 +12,7 @@ echo "*** Testing intval() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index fa7410930f314d59aa508d10492a89c2de3ebd35..6b87f07e63b1c96dffdf0942d10723a00a496036 100644 (file)
@@ -12,7 +12,7 @@ echo "*** Testing ip2long() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index 93efc098b5f57721c6d5254891725881c4246513..aa3b8310ff82b6c85f879bb2622a8abeb45976c5 100644 (file)
@@ -17,7 +17,7 @@ echo "*** Testing long2ip() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }
index d6d3a45e01604ee60f640e7c561ac3e0972515fe..0677ba10afbc69b2c2bec7f43dd7b73b1c43b41e 100644 (file)
@@ -14,7 +14,7 @@ echo "*** Testing ob_implicit_flush() : usage variation ***\n";
 
 // Define error handler
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       if (error_reporting() != 0) {
+       if (error_reporting() & $err_no) {
                // report non-silenced errors
                echo "Error: $err_no - $err_msg, $filename($linenum)\n";
        }