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) {
}
}
}