Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Zend/tests/bug29890.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Bug #29890 (crash if error handler fails)
--FILE--
<?php
function customErrorHandler($fErrNo,$fErrStr,$fErrFile,$fErrLine,$fClass) {
function customErrorHandler($fErrNo,$fErrStr,$fErrFile,$fErrLine) {
echo "error :".$fErrStr."\n";
}

Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/bug29896.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Bug #29896 (Backtrace argument list out of sync)
--FILE--
<?php
function userErrorHandler($num, $msg, $file, $line, $vars)
function userErrorHandler($num, $msg, $file, $line)
{
debug_print_backtrace();
}
Expand All @@ -22,6 +22,6 @@ function GenerateError2($A1)
GenerateError2("Test2");
?>
--EXPECTF--
#0 userErrorHandler(8, Undefined variable: b, %sbug29896.php, 11, Array ([A1] => Test1)) called at [%sbug29896.php:11]
#0 userErrorHandler(8, Undefined variable: b, %sbug29896.php, 11) called at [%sbug29896.php:11]
#1 GenerateError1(Test1) called at [%sbug29896.php:16]
#2 GenerateError2(Test2) called at [%sbug29896.php:19]
2 changes: 1 addition & 1 deletion Zend/tests/bug35017.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ try {
} catch(Exception $e) {
echo "This Exception should be caught\n";
}
function errorHandler($errno, $errstr, $errfile, $errline, $vars) {
function errorHandler($errno, $errstr, $errfile, $errline) {
throw new Exception('Some Exception');
}
?>
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug41209.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ echo "Done\n";
--EXPECTF--
Fatal error: Uncaught ErrorException: Undefined variable: id in %s:%d
Stack trace:
#0 %s(%d): env::errorHandler(8, '%s', '%s', 34, Array)
#0 %s(%d): env::errorHandler(8, '%s', '%s', 34)
#1 {main}
thrown in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/bug45805.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $o->bar();
--EXPECTF--
Fatal error: Uncaught RuntimeException in %sbug45805.php:%d
Stack trace:
#0 %sbug45805.php(%d): PHPUnit_Util_ErrorHandler::handleError(8, 'Only variables ...', '%s', %d, Array)
#0 %sbug45805.php(%d): PHPUnit_Util_ErrorHandler::handleError(8, 'Only variables ...', '%s', %d)
#1 [internal function]: B->foo()
#2 %sbug45805.php(%d): ReflectionMethod->invoke(Object(B))
#3 %sbug45805.php(%d): B->bar()
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug48004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Bug #48004 (Error handler prevents creation of default object)
--FILE--
<?php
function error_handler($errno, $errstr, $errfile, $errline, $errcontext) {
function error_handler($errno, $errstr, $errfile, $errline) {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug51394.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ $a = $empty($b);
--EXPECTF--
Fatal error: Uncaught Exception: error! in %sbug51394.php:%d
Stack trace:
#0 %sbug51394.php(%d): eh(8, 'Undefined varia%s', '%s', %d, Array)
#0 %sbug51394.php(%d): eh(8, 'Undefined varia%s', '%s', %d)
#1 {main}
thrown in %sbug51394.php on line %d
2 changes: 1 addition & 1 deletion Zend/tests/bug60909_1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require 'notfound.php';
error(require(notfound.php): failed to open stream: %s)
Warning: Uncaught Exception: Foo in %sbug60909_1.php:5
Stack trace:
#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8, Array)
#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8)
#1 %sbug60909_1.php(8): require()
#2 {main}
thrown in %sbug60909_1.php on line 5
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug61767.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Error handler called (Undefined variable: undefined)

Fatal error: Uncaught ErrorException: Undefined variable: undefined in %sbug61767.php:%d
Stack trace:
#0 %sbug61767.php(%d): {closure}(%s, 'Undefined varia...', '%s', %d, Array)
#0 %sbug61767.php(%d): {closure}(%s, 'Undefined varia...', '%s', %d)
#1 {main}
thrown in %sbug61767.php on line %d
Shutting down
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug64960.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete o

Fatal error: Uncaught Exception in %sbug64960.php:19
Stack trace:
#0 [internal function]: {closure}(8, 'ob_end_clean():...', '%s', 9, Array)
#0 [internal function]: {closure}(8, 'ob_end_clean():...', '%s', 9)
#1 %sbug64960.php(9): ob_end_clean()
#2 [internal function]: ExceptionHandler->__invoke(Object(Exception))
#3 {main}
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug69388.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Bug #69388: Use after free on recursive calls to PHP compiler
--FILE--
<?php

function handle_error($code, $message, $file, $line, $context) {
function handle_error($code, $message, $file, $line) {
if (!function_exists("bla")) {
eval('function bla($s) {echo "$s\n";}');
}
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug69388_2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Bug #69388 - Variation
--FILE--
<?php
function handle_error($code, $message, $file, $line, $context) {
function handle_error($code, $message, $file, $line) {
eval('namespace Foo;');
echo "$message\n";
}
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug72057.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set_error_handler(
--EXPECTF--
Fatal error: Uncaught Exception: My custom error in %s:%d
Stack trace:
#0 %s(%d): {closure}(8, 'A non well form...', '%s', %d, Array)
#0 %s(%d): {closure}(8, 'A non well form...', '%s', %d)
#1 %s(%d): {closure}('7as')
#2 {main}
thrown in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/bug72101.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ $foo->bar($a, $b, $c);
--EXPECTF--
Fatal error: Uncaught Error: Class 'DoesNotExists' not found in %sbug72101.php:61
Stack trace:
#0 %sbug72101.php(8): {closure}(2, 'Parameter 1 to ...', '%s', 8, Array)
#0 %sbug72101.php(8): {closure}(2, 'Parameter 1 to ...', '%s', 8)
#1 %sbug72101.php(27): PHPUnit_Framework_MockObject_Stub_ReturnCallback->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#2 %sbug72101.php(19): PHPUnit_Framework_MockObject_Matcher->invoked(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#3 %sbug72101.php(52): PHPUnit_Framework_MockObject_InvocationMocker->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug76025.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ $c = $b[$a];
--EXPECTF--
Fatal error: Uncaught Exception: blah in %sbug76025.php:%d
Stack trace:
#0 %sbug76025.php(%d): handleError(8, 'Undefined varia...', '%s', %d, Array)
#0 %sbug76025.php(%d): handleError(8, 'Undefined varia...', '%s', %d)
#1 {main}
thrown in %sbug76025.php on line %d
2 changes: 1 addition & 1 deletion Zend/tests/bug76534.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ $y = &$x["bar"];
--EXPECTF--
Fatal error: Uncaught Exception: Illegal string offset 'bar' in %sbug76534.php:%d
Stack trace:
#0 %sbug76534.php(%d): {closure}(2, 'Illegal string ...', '%s', %d, Array)
#0 %sbug76534.php(%d): {closure}(2, 'Illegal string ...', '%s', %d)
#1 {main}
thrown in %sbug76534.php on line %d
2 changes: 1 addition & 1 deletion Zend/tests/nowdoc_015.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Test nowdoc and line numbering
--FILE--
<?php
function error_handler($num, $msg, $file, $line, $vars) {
function error_handler($num, $msg, $file, $line) {
echo $line,"\n";
}
set_error_handler('error_handler');
Expand Down
15 changes: 2 additions & 13 deletions Zend/zend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ static ZEND_COLD void zend_error_va_list(int type, const char *format, va_list a
va_list args;
#endif
va_list usr_copy;
zval params[5];
zval params[4];
zval retval;
const char *error_filename;
uint32_t error_lineno = 0;
Expand All @@ -1255,7 +1255,6 @@ static ZEND_COLD void zend_error_va_list(int type, const char *format, va_list a
zend_class_entry *saved_class_entry;
zend_stack loop_var_stack;
zend_stack delayed_oplines_stack;
zend_array *symbol_table;
zend_class_entry *orig_fake_scope;

/* Report about uncaught exception in case of fatal errors */
Expand Down Expand Up @@ -1385,15 +1384,6 @@ static ZEND_COLD void zend_error_va_list(int type, const char *format, va_list a

ZVAL_LONG(&params[3], error_lineno);

symbol_table = zend_rebuild_symbol_table();

/* during shutdown the symbol table table can be still null */
if (!symbol_table) {
ZVAL_NULL(&params[4]);
} else {
ZVAL_ARR(&params[4], zend_array_dup(symbol_table));
}

ZVAL_COPY_VALUE(&orig_user_error_handler, &EG(user_error_handler));
ZVAL_UNDEF(&EG(user_error_handler));

Expand All @@ -1414,7 +1404,7 @@ static ZEND_COLD void zend_error_va_list(int type, const char *format, va_list a
orig_fake_scope = EG(fake_scope);
EG(fake_scope) = NULL;

if (call_user_function(CG(function_table), NULL, &orig_user_error_handler, &retval, 5, params) == SUCCESS) {
if (call_user_function(CG(function_table), NULL, &orig_user_error_handler, &retval, 4, params) == SUCCESS) {
if (Z_TYPE(retval) != IS_UNDEF) {
if (Z_TYPE(retval) == IS_FALSE) {
zend_error_cb(type, error_filename, error_lineno, format, args);
Expand All @@ -1435,7 +1425,6 @@ static ZEND_COLD void zend_error_va_list(int type, const char *format, va_list a
CG(in_compilation) = 1;
}

zval_ptr_dtor(&params[4]);
zval_ptr_dtor(&params[2]);
zval_ptr_dtor(&params[1]);

Expand Down
2 changes: 1 addition & 1 deletion ext/iconv/tests/iconv_mime_decode.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ iconv_mime_decode()
iconv.internal_charset=iso-8859-1
--FILE--
<?php
function my_error_handler($errno, $errmsg, $filename, $linenum, $vars)
function my_error_handler($errno, $errmsg, $filename, $linenum)
{
echo "$errno: $errmsg\n";
}
Expand Down
2 changes: 1 addition & 1 deletion ext/iconv/tests/iconv_mime_encode.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ iconv_mime_encode()
iconv.internal_charset=iso-8859-1
--FILE--
<?php
function my_error_handler($errno, $errmsg, $filename, $linenum, $vars)
function my_error_handler($errno, $errmsg, $filename, $linenum)
{
echo "$errno: $errmsg\n";
}
Expand Down
2 changes: 1 addition & 1 deletion ext/iconv/tests/iconv_strpos.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ iconv_strpos()
iconv.internal_charset=ISO-8859-1
--FILE--
<?php
function my_error_handler($errno, $errmsg, $filename, $linenum, $vars)
function my_error_handler($errno, $errmsg, $filename, $linenum)
{
echo "$errno: $errmsg\n";
}
Expand Down
2 changes: 1 addition & 1 deletion ext/iconv/tests/iconv_strrpos.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ iconv_strrpos()
iconv.internal_charset=ISO-8859-1
--FILE--
<?php
function my_error_handler($errno, $errmsg, $filename, $linenum, $vars)
function my_error_handler($errno, $errmsg, $filename, $linenum)
{
echo "$errno: $errmsg\n";
}
Expand Down
2 changes: 1 addition & 1 deletion ext/mbstring/tests/common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

// Custom Error Hanlder for testing
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
global $debug;

$err_type = array (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function_exists('mb_substitute_character') or die("skip mb_substitute_character(
echo "*** Testing mb_substitute_character() : usage variation ***\n";

// Define error handler
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
if (error_reporting() != 0) {
// report non-silenced errors
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/tests/posix_ttyname_variation6.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ echo "*** Test substituting argument 1 with object values ***\n";



function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
if (error_reporting() != 0) {
// report non-silenced errors
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
Expand Down
2 changes: 1 addition & 1 deletion ext/spl/tests/class_implements_variation1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ echo "*** Testing class_implements() : variation ***\n";


// Define error handler
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
if (error_reporting() != 0) {
// report non-silenced errors
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
Expand Down
2 changes: 1 addition & 1 deletion ext/spl/tests/class_uses_variation1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ echo "*** Testing class_uses() : variation ***\n";


// Define error handler
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
if (error_reporting() != 0) {
// report non-silenced errors
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class classWithoutToString
}

// Define error handler
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
if (error_reporting() != 0) {
// report non-silenced errors
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $array2 = array('blue' => 1, 'red' => 2, 'green' => 3, 'purple' => 4);
$array3 = array(1, 2, 3, 4, 5);

// Define error handler
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
if (error_reporting() != 0) {
// report non-silenced errors
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red");
$array2 = array("a" => "green", "yellow", "red");
$array3 = array("a"=>"green", "brown");
// Define error handler
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
if (error_reporting() != 0) {
// report non-silenced errors
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8);
$array3 = array("a"=>"green", "cyan");

// Define error handler
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
if (error_reporting() != 0) {
// report non-silenced errors
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/tests/array/array_multisort_variation1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Test array_multisort() function : usage variation
echo "*** Testing array_multisort() : usage variation ***\n";

// Define error handler
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
if (error_reporting() != 0) {
// report non-silenced errors
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/tests/array/array_multisort_variation2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Test array_multisort() function : usage variation
echo "*** Testing array_multisort() : usage variation ***\n";

// Define error handler
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
if (error_reporting() != 0) {
// report non-silenced errors
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/tests/array/array_multisort_variation3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Test array_multisort() function : usage variation
echo "*** Testing array_multisort() : usage variation ***\n";

// Define error handler
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
if (error_reporting() != 0) {
// report non-silenced errors
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/tests/array/array_multisort_variation8.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Test array_multisort() function : usage variation - test sort order of all types
echo "*** Testing array_multisort() : usage variation - test sort order of all types***\n";

// Define error handler
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
// We're testing sort order not errors so ignore.
}
set_error_handler('test_error_handler');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Test get_class_methods() function : usage variations - unexpected types
*/


function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
}
set_error_handler('test_error_handler');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spl_autoload_register(function ($className) {
echo "In autoload($className)\n";
});

function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
}
set_error_handler('test_error_handler');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spl_autoload_register(function ($className) {
echo "In autoload($className)\n";
});

function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
}
set_error_handler('test_error_handler');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spl_autoload_register(function ($className) {
echo "In autoload($className)\n";
});

function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
}
set_error_handler('test_error_handler');
Expand Down
Loading