Skip to content

Commit 2f1f349

Browse files
committed
Remove $errcontext argument to error handlers
I'm removing the argument entirely here, but we might want to change this to passing null or and empty array instead, if the impact of dropping it entirely turns out to be too large. This was deprecated as part of https://wiki.php.net/rfc/deprecations_php_7_2 as a doc-only deprecation.
1 parent 790798f commit 2f1f349

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+49
-59
lines changed

UPGRADING

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ PHP 8.0 UPGRADE NOTES
3434
interpreted as strings.
3535
. Removed ability to specify an autoloader using an __autoload() function.
3636
spl_autoload_register() should be used instead.
37+
. Removed the $errcontext argument for custom error handlers.
3738
. Removed create_function(). Anonymous functions may be used instead.
3839
. Removed each(). foreach or ArrayIterator should be used instead.
3940
. Removed ability to unbind $this from closures that were created from a

Zend/tests/bug29890.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Bug #29890 (crash if error handler fails)
33
--FILE--
44
<?php
5-
function customErrorHandler($fErrNo,$fErrStr,$fErrFile,$fErrLine,$fClass) {
5+
function customErrorHandler($fErrNo,$fErrStr,$fErrFile,$fErrLine) {
66
echo "error :".$fErrStr."\n";
77
}
88

Zend/tests/bug29896.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Bug #29896 (Backtrace argument list out of sync)
33
--FILE--
44
<?php
5-
function userErrorHandler($num, $msg, $file, $line, $vars)
5+
function userErrorHandler($num, $msg, $file, $line)
66
{
77
debug_print_backtrace();
88
}
@@ -22,6 +22,6 @@ function GenerateError2($A1)
2222
GenerateError2("Test2");
2323
?>
2424
--EXPECTF--
25-
#0 userErrorHandler(8, Undefined variable: b, %sbug29896.php, 11, Array ([A1] => Test1)) called at [%sbug29896.php:11]
25+
#0 userErrorHandler(8, Undefined variable: b, %sbug29896.php, 11) called at [%sbug29896.php:11]
2626
#1 GenerateError1(Test1) called at [%sbug29896.php:16]
2727
#2 GenerateError2(Test2) called at [%sbug29896.php:19]

Zend/tests/bug35017.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ try {
1313
} catch(Exception $e) {
1414
echo "This Exception should be caught\n";
1515
}
16-
function errorHandler($errno, $errstr, $errfile, $errline, $vars) {
16+
function errorHandler($errno, $errstr, $errfile, $errline) {
1717
throw new Exception('Some Exception');
1818
}
1919
?>

Zend/tests/bug41209.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ echo "Done\n";
4141
--EXPECTF--
4242
Fatal error: Uncaught ErrorException: Undefined variable: id in %s:%d
4343
Stack trace:
44-
#0 %s(%d): env::errorHandler(8, '%s', '%s', 34, Array)
44+
#0 %s(%d): env::errorHandler(8, '%s', '%s', 34)
4545
#1 {main}
4646
thrown in %s on line %d

Zend/tests/bug45805.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ $o->bar();
3838
--EXPECTF--
3939
Fatal error: Uncaught RuntimeException in %sbug45805.php:%d
4040
Stack trace:
41-
#0 %sbug45805.php(%d): PHPUnit_Util_ErrorHandler::handleError(8, 'Only variables ...', '%s', %d, Array)
41+
#0 %sbug45805.php(%d): PHPUnit_Util_ErrorHandler::handleError(8, 'Only variables ...', '%s', %d)
4242
#1 [internal function]: B->foo()
4343
#2 %sbug45805.php(%d): ReflectionMethod->invoke(Object(B))
4444
#3 %sbug45805.php(%d): B->bar()

Zend/tests/bug48004.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Bug #48004 (Error handler prevents creation of default object)
33
--FILE--
44
<?php
5-
function error_handler($errno, $errstr, $errfile, $errline, $errcontext) {
5+
function error_handler($errno, $errstr, $errfile, $errline) {
66
return true;
77
}
88

Zend/tests/bug51394.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ $a = $empty($b);
1515
--EXPECTF--
1616
Fatal error: Uncaught Exception: error! in %sbug51394.php:%d
1717
Stack trace:
18-
#0 %sbug51394.php(%d): eh(8, 'Undefined varia%s', '%s', %d, Array)
18+
#0 %sbug51394.php(%d): eh(8, 'Undefined varia%s', '%s', %d)
1919
#1 {main}
2020
thrown in %sbug51394.php on line %d

Zend/tests/bug60909_1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require 'notfound.php';
1313
error(require(notfound.php): failed to open stream: %s)
1414
Warning: Uncaught Exception: Foo in %sbug60909_1.php:5
1515
Stack trace:
16-
#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8, Array)
16+
#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8)
1717
#1 %sbug60909_1.php(8): require()
1818
#2 {main}
1919
thrown in %sbug60909_1.php on line 5

Zend/tests/bug61767.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Error handler called (Undefined variable: undefined)
1919

2020
Fatal error: Uncaught ErrorException: Undefined variable: undefined in %sbug61767.php:%d
2121
Stack trace:
22-
#0 %sbug61767.php(%d): {closure}(%s, 'Undefined varia...', '%s', %d, Array)
22+
#0 %sbug61767.php(%d): {closure}(%s, 'Undefined varia...', '%s', %d)
2323
#1 {main}
2424
thrown in %sbug61767.php on line %d
2525
Shutting down

0 commit comments

Comments
 (0)