diff --git a/ext/standard/tests/general_functions/error_get_last.phpt b/ext/standard/tests/general_functions/error_get_last.phpt index 4dc72c93c6a7c..0b5745373d53f 100644 --- a/ext/standard/tests/general_functions/error_get_last.phpt +++ b/ext/standard/tests/general_functions/error_get_last.phpt @@ -15,18 +15,7 @@ $a = $b; var_dump(error_get_last()); -function trigger_fatal_error_with_stacktrace() { - ini_set('fatal_error_backtraces', true); - - eval("class Foo {}; class Foo {}"); -} - -register_shutdown_function(function() { - var_dump(error_get_last()); - echo "Done\n"; -}); - -trigger_fatal_error_with_stacktrace(); +echo "Done\n" ?> --EXPECTF-- NULL @@ -44,44 +33,4 @@ array(4) { ["line"]=> int(11) } - -Fatal error: Cannot redeclare class Foo (%s) in %s on line %d -Stack trace: -#0 %serror_get_last.php(%d): eval() -#1 %serror_get_last.php(%d): trigger_fatal_error_with_stacktrace() -#2 {main} -array(5) { - ["type"]=> - int(64) - ["message"]=> - string(%d) "Cannot redeclare class Foo %s" - ["file"]=> - string(%d) "%serror_get_last.php(%d) : eval()'d code" - ["line"]=> - int(%d) - ["trace"]=> - array(2) { - [0]=> - array(3) { - ["file"]=> - string(%d) "%serror_get_last.php" - ["line"]=> - int(%d) - ["function"]=> - string(%d) "eval" - } - [1]=> - array(4) { - ["file"]=> - string(%d) "%serror_get_last.php" - ["line"]=> - int(%d) - ["function"]=> - string(%d) "trigger_fatal_error_with_stacktrace" - ["args"]=> - array(0) { - } - } - } -} Done diff --git a/ext/standard/tests/general_functions/error_get_last_002.phpt b/ext/standard/tests/general_functions/error_get_last_002.phpt new file mode 100644 index 0000000000000..45013ba68d66a --- /dev/null +++ b/ext/standard/tests/general_functions/error_get_last_002.phpt @@ -0,0 +1,59 @@ +--TEST-- +error_get_last() w/ fatal error +--INI-- +fatal_error_backtraces=On +--FILE-- + +--EXPECTF-- +Fatal error: Cannot redeclare class Foo (%s) in %s on line %d +Stack trace: +#0 %serror_get_last_002.php(%d): eval() +#1 %serror_get_last_002.php(%d): trigger_fatal_error_with_stacktrace() +#2 {main} +array(5) { + ["type"]=> + int(64) + ["message"]=> + string(%d) "Cannot redeclare class Foo %s" + ["file"]=> + string(%d) "%serror_get_last_002.php(%d) : eval()'d code" + ["line"]=> + int(%d) + ["trace"]=> + array(2) { + [0]=> + array(3) { + ["file"]=> + string(%d) "%serror_get_last_002.php" + ["line"]=> + int(%d) + ["function"]=> + string(%d) "eval" + } + [1]=> + array(4) { + ["file"]=> + string(%d) "%serror_get_last_002.php" + ["line"]=> + int(%d) + ["function"]=> + string(%d) "trigger_fatal_error_with_stacktrace" + ["args"]=> + array(0) { + } + } + } +} +Done