note 111974 added to exception.gettrace
| From: | knivey | Date: | Thu, 18 Apr 2013 14:53:21 +0000 |
| Subject: | note 111974 added to exception.gettrace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-194532@lists.php.net to get a copy of this message | ||
The order of the trace starts at the source of the exception and does not include main.
So for example:
<?php
function Bar() {
throw new Exception;
}
function Foo() {
Bar();
}
try {
Foo();
} catch(Exception $e) {
var_dump($e->getTrace());
}
?>
Will output:
array(2) {
[0]=>
array(4) {
["file"]=>
string(21) "/.../test.php"
["line"]=>
int(8)
["function"]=>
string(3) "Bar"
["args"]=>
array(0) {
}
}
[1]=>
array(4) {
["file"]=>
string(21) "/.../test.php"
["line"]=>
int(12)
["function"]=>
string(3) "Foo"
["args"]=>
array(0) {
}
}
}
----
Server IP: 69.147.83.199
Probable Submitter: 71.48.76.119
----
Manual Page -- http://php.net/manual/en/exception.gettrace.php
Edit -- https://master.php.net/note/edit/111974
Del: integrated -- https://master.php.net/note/delete/111974/integrated
Del: useless -- https://master.php.net/note/delete/111974/useless
Del: bad code -- https://master.php.net/note/delete/111974/bad+code
Del: spam -- https://master.php.net/note/delete/111974/spam
Del: non-english -- https://master.php.net/note/delete/111974/non-english
Del: in docs -- https://master.php.net/note/delete/111974/in+docs
Del: other reasons-- https://master.php.net/note/delete/111974
Reject -- https://master.php.net/note/reject/111974
Search -- https://master.php.net/manage/user-notes.php