ID:               7440
 Updated by:       [EMAIL PROTECTED]
 Reported By:      feng at i-bizz dot net
-Status:           Open
+Status:           Closed
 Bug Type:         Feature/Change Request
 Operating System: anyone
 PHP Version:      4.0.3pl1
 New Comment:

Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php

PHP 4.3 and higher have debug_backtrace() (and print_debug_backtrace())
for this.




Previous Comments:
------------------------------------------------------------------------

[2002-01-28 20:24:17] [EMAIL PROTECTED]

Use APD for now. (It's not standard extension though...)
http://apd.communityconnect.com/

------------------------------------------------------------------------

[2000-10-24 16:53:06] feng at i-bizz dot net

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 this bug report at http://bugs.php.net/?id=7440&edit=1

Reply via email to