From: Nikita Popov Date: Thu, 31 Jan 2019 08:39:10 +0000 (+0100) Subject: Revert "Don't silence fatal errors with @" X-Git-Tag: php-7.4.0alpha1~1139 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=340c6d392720f4681a46b58cfe9a002ce5b7e8b6;p=php Revert "Don't silence fatal errors with @" This reverts commit abd36289e26cc0365e82373699aba4c1ffff464d. This wasn't ready for merging yet, there are still some test failures. --- diff --git a/UPGRADING b/UPGRADING index a063b91fdb..c735b4d521 100644 --- a/UPGRADING +++ b/UPGRADING @@ -25,10 +25,6 @@ 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. diff --git a/Zend/tests/bug34786.phpt b/Zend/tests/bug34786.phpt index ef0627633f..18642848d8 100644 --- a/Zend/tests/bug34786.phpt +++ b/Zend/tests/bug34786.phpt @@ -10,13 +10,13 @@ function bar() { echo "bar: ".error_reporting()."\n"; } -error_reporting(E_WARNING); +error_reporting(1); echo "before: ".error_reporting()."\n"; @foo(1,@bar(),3); echo "after: ".error_reporting()."\n"; ?> --EXPECT-- -before: 2 +before: 1 bar: 0 foo: 0 -after: 2 +after: 1 diff --git a/Zend/zend_errors.h b/Zend/zend_errors.h index ac48ef60ad..9932b1e47e 100644 --- a/Zend/zend_errors.h +++ b/Zend/zend_errors.h @@ -39,11 +39,6 @@ #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 */ /* diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 03c621f08f..2b832b6f0d 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -3755,8 +3755,7 @@ 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 (E_HAS_ONLY_FATAL_ERRORS(EG(error_reporting)) - && !E_HAS_ONLY_FATAL_ERRORS(Z_LVAL_P(var))) { + if (!EG(error_reporting) && Z_LVAL_P(var) != 0) { EG(error_reporting) = Z_LVAL_P(var); } } diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 8d6c972b9c..060c4bf6fe 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -6690,10 +6690,9 @@ ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY) ZVAL_LONG(EX_VAR(opline->result.var), EG(error_reporting)); - if (!E_HAS_ONLY_FATAL_ERRORS(EG(error_reporting))) { + if (EG(error_reporting)) { do { - /* Do not silence fatal errors */ - EG(error_reporting) &= E_FATAL_ERRORS; + EG(error_reporting) = 0; if (!EG(error_reporting_ini_entry)) { zval *zv = zend_hash_find_ex(EG(ini_directives), ZSTR_KNOWN(ZEND_STR_ERROR_REPORTING), 1); if (zv) { @@ -6722,8 +6721,7 @@ ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY) { USE_OPLINE - if (E_HAS_ONLY_FATAL_ERRORS(EG(error_reporting)) - && !E_HAS_ONLY_FATAL_ERRORS(Z_LVAL_P(EX_VAR(opline->op1.var)))) { + if (!EG(error_reporting) && Z_LVAL_P(EX_VAR(opline->op1.var)) != 0) { EG(error_reporting) = Z_LVAL_P(EX_VAR(opline->op1.var)); } ZEND_VM_NEXT_OPCODE(); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 7e9ef62eff..d8258c9783 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1523,10 +1523,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEN ZVAL_LONG(EX_VAR(opline->result.var), EG(error_reporting)); - if (!E_HAS_ONLY_FATAL_ERRORS(EG(error_reporting))) { + if (EG(error_reporting)) { do { - /* Do not silence fatal errors */ - EG(error_reporting) &= E_FATAL_ERRORS; + EG(error_reporting) = 0; if (!EG(error_reporting_ini_entry)) { zval *zv = zend_hash_find_ex(EG(ini_directives), ZSTR_KNOWN(ZEND_STR_ERROR_REPORTING), 1); if (zv) { @@ -19505,8 +19504,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_END_SILENCE_SPEC_TMP_HANDLER(Z { USE_OPLINE - if (E_HAS_ONLY_FATAL_ERRORS(EG(error_reporting)) - && !E_HAS_ONLY_FATAL_ERRORS(Z_LVAL_P(EX_VAR(opline->op1.var)))) { + if (!EG(error_reporting) && Z_LVAL_P(EX_VAR(opline->op1.var)) != 0) { EG(error_reporting) = Z_LVAL_P(EX_VAR(opline->op1.var)); } ZEND_VM_NEXT_OPCODE(); diff --git a/ext/standard/tests/array/array_multisort_variation1.phpt b/ext/standard/tests/array/array_multisort_variation1.phpt index f8d012b395..9a33a270f1 100644 --- a/ext/standard/tests/array/array_multisort_variation1.phpt +++ b/ext/standard/tests/array/array_multisort_variation1.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/array/array_multisort_variation2.phpt b/ext/standard/tests/array/array_multisort_variation2.phpt index ca5c08940c..8c26a8347b 100644 --- a/ext/standard/tests/array/array_multisort_variation2.phpt +++ b/ext/standard/tests/array/array_multisort_variation2.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/array/array_multisort_variation3.phpt b/ext/standard/tests/array/array_multisort_variation3.phpt index a13755e405..28130e31fd 100644 --- a/ext/standard/tests/array/array_multisort_variation3.phpt +++ b/ext/standard/tests/array/array_multisort_variation3.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/basename_variation3.phpt b/ext/standard/tests/file/basename_variation3.phpt index ee3395bc84..684e538d76 100644 --- a/ext/standard/tests/file/basename_variation3.phpt +++ b/ext/standard/tests/file/basename_variation3.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/basename_variation4.phpt b/ext/standard/tests/file/basename_variation4.phpt index 12852a3261..2bb94870df 100644 --- a/ext/standard/tests/file/basename_variation4.phpt +++ b/ext/standard/tests/file/basename_variation4.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/chmod_variation3.phpt b/ext/standard/tests/file/chmod_variation3.phpt index dcb7fc3bbb..bc6f0dc860 100644 --- a/ext/standard/tests/file/chmod_variation3.phpt +++ b/ext/standard/tests/file/chmod_variation3.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/chmod_variation4.phpt b/ext/standard/tests/file/chmod_variation4.phpt index cd04e48928..e0da9f66ee 100644 --- a/ext/standard/tests/file/chmod_variation4.phpt +++ b/ext/standard/tests/file/chmod_variation4.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/dirname_variation1.phpt b/ext/standard/tests/file/dirname_variation1.phpt index 339f63b9f4..5e97982a9a 100644 --- a/ext/standard/tests/file/dirname_variation1.phpt +++ b/ext/standard/tests/file/dirname_variation1.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/file_get_contents_variation3.phpt b/ext/standard/tests/file/file_get_contents_variation3.phpt index 81413b1fcd..9e8de27f3f 100644 --- a/ext/standard/tests/file/file_get_contents_variation3.phpt +++ b/ext/standard/tests/file/file_get_contents_variation3.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/file_get_contents_variation4.phpt b/ext/standard/tests/file/file_get_contents_variation4.phpt index 041d81220f..0ca7a6bf20 100644 --- a/ext/standard/tests/file/file_get_contents_variation4.phpt +++ b/ext/standard/tests/file/file_get_contents_variation4.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/file_get_contents_variation5_64bit.phpt b/ext/standard/tests/file/file_get_contents_variation5_64bit.phpt index 104ad6e6d7..d0b74757d2 100644 --- a/ext/standard/tests/file/file_get_contents_variation5_64bit.phpt +++ b/ext/standard/tests/file/file_get_contents_variation5_64bit.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/file_get_contents_variation6.phpt b/ext/standard/tests/file/file_get_contents_variation6.phpt index 1a547c5fa4..f30cac10d2 100644 --- a/ext/standard/tests/file/file_get_contents_variation6.phpt +++ b/ext/standard/tests/file/file_get_contents_variation6.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/file_put_contents_variation2.phpt b/ext/standard/tests/file/file_put_contents_variation2.phpt index 1d5fd98946..ae56486d5f 100644 --- a/ext/standard/tests/file/file_put_contents_variation2.phpt +++ b/ext/standard/tests/file/file_put_contents_variation2.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/file_put_contents_variation3.phpt b/ext/standard/tests/file/file_put_contents_variation3.phpt index 5808fd37c7..74130007a7 100644 --- a/ext/standard/tests/file/file_put_contents_variation3.phpt +++ b/ext/standard/tests/file/file_put_contents_variation3.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/file_variation2.phpt b/ext/standard/tests/file/file_variation2.phpt index 6f8619d74f..9c3ad0e546 100644 --- a/ext/standard/tests/file/file_variation2.phpt +++ b/ext/standard/tests/file/file_variation2.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/file_variation3.phpt b/ext/standard/tests/file/file_variation3.phpt index 81348cac92..014adec6d8 100644 --- a/ext/standard/tests/file/file_variation3.phpt +++ b/ext/standard/tests/file/file_variation3.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/file_variation4.phpt b/ext/standard/tests/file/file_variation4.phpt index 7a8a120223..103c2b0af6 100644 --- a/ext/standard/tests/file/file_variation4.phpt +++ b/ext/standard/tests/file/file_variation4.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/fopen_variation3.phpt b/ext/standard/tests/file/fopen_variation3.phpt index a714cd7000..fb00b243fc 100644 --- a/ext/standard/tests/file/fopen_variation3.phpt +++ b/ext/standard/tests/file/fopen_variation3.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/fopen_variation4.phpt b/ext/standard/tests/file/fopen_variation4.phpt index f18d70a630..15f9e60c5a 100644 --- a/ext/standard/tests/file/fopen_variation4.phpt +++ b/ext/standard/tests/file/fopen_variation4.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/fwrite_variation5.phpt b/ext/standard/tests/file/fwrite_variation5.phpt index b0151e921d..ff1214c527 100644 --- a/ext/standard/tests/file/fwrite_variation5.phpt +++ b/ext/standard/tests/file/fwrite_variation5.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/mkdir_variation1.phpt b/ext/standard/tests/file/mkdir_variation1.phpt index 85ec358b07..c77c66b531 100644 --- a/ext/standard/tests/file/mkdir_variation1.phpt +++ b/ext/standard/tests/file/mkdir_variation1.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/mkdir_variation2.phpt b/ext/standard/tests/file/mkdir_variation2.phpt index 7ff3774d66..51a1c39c17 100644 --- a/ext/standard/tests/file/mkdir_variation2.phpt +++ b/ext/standard/tests/file/mkdir_variation2.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/mkdir_variation3.phpt b/ext/standard/tests/file/mkdir_variation3.phpt index 114d7b0355..4c037b6bca 100644 --- a/ext/standard/tests/file/mkdir_variation3.phpt +++ b/ext/standard/tests/file/mkdir_variation3.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/mkdir_variation4.phpt b/ext/standard/tests/file/mkdir_variation4.phpt index 9aedc0c7c9..a31ae722c6 100644 --- a/ext/standard/tests/file/mkdir_variation4.phpt +++ b/ext/standard/tests/file/mkdir_variation4.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/parse_ini_file_variation4.phpt b/ext/standard/tests/file/parse_ini_file_variation4.phpt index 2c8a80becf..15acc9c3c5 100644 --- a/ext/standard/tests/file/parse_ini_file_variation4.phpt +++ b/ext/standard/tests/file/parse_ini_file_variation4.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/parse_ini_file_variation5.phpt b/ext/standard/tests/file/parse_ini_file_variation5.phpt index 166fa09c8c..4cfc2a661f 100644 --- a/ext/standard/tests/file/parse_ini_file_variation5.phpt +++ b/ext/standard/tests/file/parse_ini_file_variation5.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/pathinfo_variation1.phpt b/ext/standard/tests/file/pathinfo_variation1.phpt index 2170491023..36d9bab5ae 100644 --- a/ext/standard/tests/file/pathinfo_variation1.phpt +++ b/ext/standard/tests/file/pathinfo_variation1.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/pathinfo_variation2.phpt b/ext/standard/tests/file/pathinfo_variation2.phpt index 265364e48f..a39543b18f 100644 --- a/ext/standard/tests/file/pathinfo_variation2.phpt +++ b/ext/standard/tests/file/pathinfo_variation2.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/pclose_variation1.phpt b/ext/standard/tests/file/pclose_variation1.phpt index c328534c65..7c22389646 100644 --- a/ext/standard/tests/file/pclose_variation1.phpt +++ b/ext/standard/tests/file/pclose_variation1.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/readfile_variation4.phpt b/ext/standard/tests/file/readfile_variation4.phpt index e9378bee90..99ee79e40b 100644 --- a/ext/standard/tests/file/readfile_variation4.phpt +++ b/ext/standard/tests/file/readfile_variation4.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/readfile_variation5.phpt b/ext/standard/tests/file/readfile_variation5.phpt index d8cecbd14c..bc9c064055 100644 --- a/ext/standard/tests/file/readfile_variation5.phpt +++ b/ext/standard/tests/file/readfile_variation5.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/rename_variation10.phpt b/ext/standard/tests/file/rename_variation10.phpt index 62b156ae01..8ee59168b1 100644 --- a/ext/standard/tests/file/rename_variation10.phpt +++ b/ext/standard/tests/file/rename_variation10.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/rmdir_variation1.phpt b/ext/standard/tests/file/rmdir_variation1.phpt index 5a802e5d2a..0556266efa 100644 --- a/ext/standard/tests/file/rmdir_variation1.phpt +++ b/ext/standard/tests/file/rmdir_variation1.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/rmdir_variation2.phpt b/ext/standard/tests/file/rmdir_variation2.phpt index 4f57de7c48..7555200344 100644 --- a/ext/standard/tests/file/rmdir_variation2.phpt +++ b/ext/standard/tests/file/rmdir_variation2.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/touch_variation3.phpt b/ext/standard/tests/file/touch_variation3.phpt index b6c7080a06..5eb6ad315e 100644 --- a/ext/standard/tests/file/touch_variation3.phpt +++ b/ext/standard/tests/file/touch_variation3.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/touch_variation4.phpt b/ext/standard/tests/file/touch_variation4.phpt index 32d48fdb58..190d0f4b1a 100644 --- a/ext/standard/tests/file/touch_variation4.phpt +++ b/ext/standard/tests/file/touch_variation4.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/umask_variation3.phpt b/ext/standard/tests/file/umask_variation3.phpt index 9f07e09a60..68996ab692 100644 --- a/ext/standard/tests/file/umask_variation3.phpt +++ b/ext/standard/tests/file/umask_variation3.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/file/unlink_variation7.phpt b/ext/standard/tests/file/unlink_variation7.phpt index ff83a1d548..b4a6bd5a1f 100644 --- a/ext/standard/tests/file/unlink_variation7.phpt +++ b/ext/standard/tests/file/unlink_variation7.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/general_functions/call_user_func_array_variation_002.phpt b/ext/standard/tests/general_functions/call_user_func_array_variation_002.phpt index d26944c94b..51a079ad53 100644 --- a/ext/standard/tests/general_functions/call_user_func_array_variation_002.phpt +++ b/ext/standard/tests/general_functions/call_user_func_array_variation_002.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/general_functions/call_user_func_array_variation_003.phpt b/ext/standard/tests/general_functions/call_user_func_array_variation_003.phpt index 1cc957f6bb..c8c8ce6604 100644 --- a/ext/standard/tests/general_functions/call_user_func_array_variation_003.phpt +++ b/ext/standard/tests/general_functions/call_user_func_array_variation_003.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/general_functions/intval_variation1.phpt b/ext/standard/tests/general_functions/intval_variation1.phpt index 65592fa4ad..e76d7083d4 100644 --- a/ext/standard/tests/general_functions/intval_variation1.phpt +++ b/ext/standard/tests/general_functions/intval_variation1.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/network/ip2long_variation1.phpt b/ext/standard/tests/network/ip2long_variation1.phpt index 6b87f07e63..fa7410930f 100644 --- a/ext/standard/tests/network/ip2long_variation1.phpt +++ b/ext/standard/tests/network/ip2long_variation1.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/network/long2ip_variation1.phpt b/ext/standard/tests/network/long2ip_variation1.phpt index aa3b8310ff..93efc098b5 100644 --- a/ext/standard/tests/network/long2ip_variation1.phpt +++ b/ext/standard/tests/network/long2ip_variation1.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/tests/output/ob_implicit_flush_variation_001.phpt b/tests/output/ob_implicit_flush_variation_001.phpt index 0677ba10af..d6d3a45e01 100644 --- a/tests/output/ob_implicit_flush_variation_001.phpt +++ b/tests/output/ob_implicit_flush_variation_001.phpt @@ -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() & $err_no) { + if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; }