-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move
error_get_last
w/ fatal to separate test
- Loading branch information
1 parent
aaa2443
commit 4db32ac
Showing
2 changed files
with
60 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
ext/standard/tests/general_functions/error_get_last_002.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--TEST-- | ||
error_get_last() w/ fatal error | ||
--INI-- | ||
fatal_error_backtraces=On | ||
--FILE-- | ||
<?php | ||
|
||
function trigger_fatal_error_with_stacktrace() { | ||
eval("class Foo {}; class Foo {}"); | ||
} | ||
|
||
register_shutdown_function(function() { | ||
var_dump(error_get_last()); | ||
echo "Done\n"; | ||
}); | ||
|
||
trigger_fatal_error_with_stacktrace(); | ||
?> | ||
--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 |