summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2018-11-26 21:20:03 +0100
committerJoe Watkins <krakjoe@php.net>2019-01-31 07:11:05 +0100
commitabd36289e26cc0365e82373699aba4c1ffff464d (patch)
tree1c94078f70ba7a8a4f098236e780ee9de9136179
parent25dc5f18e44686836b18851baeb348c86eeede7c (diff)
downloadphp-git-abd36289e26cc0365e82373699aba4c1ffff464d.tar.gz
Don't silence fatal errors with @
-rw-r--r--UPGRADING4
-rw-r--r--Zend/tests/bug34786.phpt6
-rw-r--r--Zend/zend_errors.h5
-rw-r--r--Zend/zend_execute.c3
-rw-r--r--Zend/zend_vm_def.h8
-rw-r--r--Zend/zend_vm_execute.h8
-rw-r--r--ext/standard/tests/array/array_multisort_variation1.phpt2
-rw-r--r--ext/standard/tests/array/array_multisort_variation2.phpt2
-rw-r--r--ext/standard/tests/array/array_multisort_variation3.phpt2
-rw-r--r--ext/standard/tests/file/basename_variation3.phpt2
-rw-r--r--ext/standard/tests/file/basename_variation4.phpt2
-rw-r--r--ext/standard/tests/file/chmod_variation3.phpt2
-rw-r--r--ext/standard/tests/file/chmod_variation4.phpt2
-rw-r--r--ext/standard/tests/file/dirname_variation1.phpt2
-rw-r--r--ext/standard/tests/file/file_get_contents_variation3.phpt2
-rw-r--r--ext/standard/tests/file/file_get_contents_variation4.phpt2
-rw-r--r--ext/standard/tests/file/file_get_contents_variation5_64bit.phpt2
-rw-r--r--ext/standard/tests/file/file_get_contents_variation6.phpt2
-rw-r--r--ext/standard/tests/file/file_put_contents_variation2.phpt2
-rw-r--r--ext/standard/tests/file/file_put_contents_variation3.phpt2
-rw-r--r--ext/standard/tests/file/file_variation2.phpt2
-rw-r--r--ext/standard/tests/file/file_variation3.phpt2
-rw-r--r--ext/standard/tests/file/file_variation4.phpt2
-rw-r--r--ext/standard/tests/file/fopen_variation3.phpt2
-rw-r--r--ext/standard/tests/file/fopen_variation4.phpt2
-rw-r--r--ext/standard/tests/file/fwrite_variation5.phpt2
-rw-r--r--ext/standard/tests/file/mkdir_variation1.phpt2
-rw-r--r--ext/standard/tests/file/mkdir_variation2.phpt2
-rw-r--r--ext/standard/tests/file/mkdir_variation3.phpt2
-rw-r--r--ext/standard/tests/file/mkdir_variation4.phpt2
-rw-r--r--ext/standard/tests/file/parse_ini_file_variation4.phpt2
-rw-r--r--ext/standard/tests/file/parse_ini_file_variation5.phpt2
-rw-r--r--ext/standard/tests/file/pathinfo_variation1.phpt2
-rw-r--r--ext/standard/tests/file/pathinfo_variation2.phpt2
-rw-r--r--ext/standard/tests/file/pclose_variation1.phpt2
-rw-r--r--ext/standard/tests/file/readfile_variation4.phpt2
-rw-r--r--ext/standard/tests/file/readfile_variation5.phpt2
-rw-r--r--ext/standard/tests/file/rename_variation10.phpt2
-rw-r--r--ext/standard/tests/file/rmdir_variation1.phpt2
-rw-r--r--ext/standard/tests/file/rmdir_variation2.phpt2
-rw-r--r--ext/standard/tests/file/touch_variation3.phpt2
-rw-r--r--ext/standard/tests/file/touch_variation4.phpt2
-rw-r--r--ext/standard/tests/file/umask_variation3.phpt2
-rw-r--r--ext/standard/tests/file/unlink_variation7.phpt2
-rw-r--r--ext/standard/tests/general_functions/call_user_func_array_variation_002.phpt2
-rw-r--r--ext/standard/tests/general_functions/call_user_func_array_variation_003.phpt2
-rw-r--r--ext/standard/tests/general_functions/intval_variation1.phpt2
-rw-r--r--ext/standard/tests/network/ip2long_variation1.phpt2
-rw-r--r--ext/standard/tests/network/long2ip_variation1.phpt2
-rw-r--r--tests/output/ob_implicit_flush_variation_001.phpt2
50 files changed, 68 insertions, 54 deletions
diff --git a/UPGRADING b/UPGRADING
index c735b4d521..a063b91fdb 100644
--- 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.
diff --git a/Zend/tests/bug34786.phpt b/Zend/tests/bug34786.phpt
index 18642848d8..ef0627633f 100644
--- a/Zend/tests/bug34786.phpt
+++ b/Zend/tests/bug34786.phpt
@@ -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
diff --git a/Zend/zend_errors.h b/Zend/zend_errors.h
index 9932b1e47e..ac48ef60ad 100644
--- a/Zend/zend_errors.h
+++ b/Zend/zend_errors.h
@@ -39,6 +39,11 @@
#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 2b832b6f0d..03c621f08f 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -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);
}
}
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 060c4bf6fe..8d6c972b9c 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -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();
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index d8258c9783..7e9ef62eff 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -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();
diff --git a/ext/standard/tests/array/array_multisort_variation1.phpt b/ext/standard/tests/array/array_multisort_variation1.phpt
index 9a33a270f1..f8d012b395 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 8c26a8347b..ca5c08940c 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 28130e31fd..a13755e405 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 684e538d76..ee3395bc84 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 2bb94870df..12852a3261 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 bc6f0dc860..dcb7fc3bbb 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 e0da9f66ee..cd04e48928 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 5e97982a9a..339f63b9f4 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 9e8de27f3f..81413b1fcd 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 0ca7a6bf20..041d81220f 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 d0b74757d2..104ad6e6d7 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 f30cac10d2..1a547c5fa4 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 ae56486d5f..1d5fd98946 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 74130007a7..5808fd37c7 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 9c3ad0e546..6f8619d74f 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 014adec6d8..81348cac92 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 103c2b0af6..7a8a120223 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 fb00b243fc..a714cd7000 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 15f9e60c5a..f18d70a630 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 ff1214c527..b0151e921d 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 c77c66b531..85ec358b07 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 51a1c39c17..7ff3774d66 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 4c037b6bca..114d7b0355 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 a31ae722c6..9aedc0c7c9 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 15acc9c3c5..2c8a80becf 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 4cfc2a661f..166fa09c8c 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 36d9bab5ae..2170491023 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 a39543b18f..265364e48f 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 7c22389646..c328534c65 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 99ee79e40b..e9378bee90 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 bc9c064055..d8cecbd14c 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 8ee59168b1..62b156ae01 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 0556266efa..5a802e5d2a 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 7555200344..4f57de7c48 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 5eb6ad315e..b6c7080a06 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 190d0f4b1a..32d48fdb58 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 68996ab692..9f07e09a60 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 b4a6bd5a1f..ff83a1d548 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 51a079ad53..d26944c94b 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 c8c8ce6604..1cc957f6bb 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 e76d7083d4..65592fa4ad 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 fa7410930f..6b87f07e63 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 93efc098b5..aa3b8310ff 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() != 0) {
+ if (error_reporting() & $err_no) {
// 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 d6d3a45e01..0677ba10af 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() != 0) {
+ if (error_reporting() & $err_no) {
// report non-silenced errors
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
}