PHP 4.0 Bug #7440: Print function calling stack
| From: | feng at i-bizz dot net | Date: | Tue, 24 Oct 2000 20:53:06 +0000 |
| Subject: | PHP 4.0 Bug #7440: Print function calling stack | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-35899@lists.php.net to get a copy of this message | ||
From: feng@i-bizz.net
Operating system: anyone
PHP version: 4.0.3pl1
PHP Bug Type: Feature/Change Request
Bug description: Print function calling stack
When we have functions who calls another function, it is very easy to lost the track of who is
calling who and who generated the bug that created an error.
Lets visually see the problem (I'm using Perl-like debug notation)
..
main.php3:5: ListBooks();
some where in main.php3 we called the ListBooks function, which is an abstraction layer for the
code that will query the database.
_sp.inc.php3:56: ExecSQL("select from BOOKS");
Somewhere (deep) inside the ListBooks() function, we have a call to ExecSQL(), which will query
the database, and have error handling routines. Here we have a type which will trigger an error (it
is missing "*" inside the string)
_commom.inc.php3:30: $q = mysql_query($query);
_commom.inc.php3:31: if (!$q$) {
_commom.inc.php3:32: echo "we have an error here!";
_commom.inc.php3:33: return mysql_error();
_commom.inc.php3:33: }
What happens here? The error will be generated at the line 30 in the file _commom.inc.php3 but it
wasn't generated there! It was generated somewhere in the upper layers, in some of the callers.
Now, wouldn't be cool if we could print the function call stack? This way we could track up,
knowing where the error could be hidden! We have a good example from the Perl debugging facilities.
--
Edit Bug report at: http://bugs.php.net/?id=7440&edit=1