You are here: Re: cleaner way to print stack traces? « PHP Programming Language « IT news, forums, messages
Re: cleaner way to print stack traces?

Posted by ELINTPimp on 08/10/07 20:45

On Aug 10, 4:08 pm, "laredotorn...@zipmail.com"
<laredotorn...@zipmail.com> wrote:
> Hi,
>
> I'm using PHP 4.4.4 witih Apache 2 on Linux. I recently discovered
> the debug_backtrace() statement. However, when I run the command,
>
> var_dump(debug_backtrace());
>
> what is printed out is a mess. See below. What is a cleaner way of
> printing out stack traces. I like the way Java does it. Anyway to
> emulate that?
>
> Thanks, - Dave
>
> array(4) { [0]=> array(4) { ["file"]=> string(65) "/usr/local/apache2/
> htdocs/refillingstation/custom_product_fns.php" ["line"]=> int(184)
> ["function"]=> string(10) "executesql" ["args"]=> array(1) { [0]=>
> &string(133) "UPDATE ORDER_FORM_CARTRIDGES SET PRICE = ROUND(3, 2),
> RETAIL_PRICE = ROUND(4, 2) WHERE P.PRODUCT_ID = 32647) WHERE
> PRODUCT_ID = 32647" } } [1]=> array(4) { ["file"]=> string(65) "/usr/
> local/apache2/htdocs/refillingstation/
> custom_product_fns.php" ["line"]=> int(148) ["function"]=> string(17)
> "updatecustomprice" ["args"]=> array(7) { [0]=> &string(1) "6" [1]=>
> &string(1) "2" [2]=> &string(6) "C4844A" [3]=> &string(9) "#10
> Black" [4]=> &float(3) [5]=> &float(4) [6]=> &string(0) "" } } [2]=>
> array(4) { ["file"]=> string(96) "/usr/local/apache2/htdocs/
> refillingstation/admin/custom_prices/
> import_custom_prices_response.php" ["line"]=> int(24) ["function"]=>
> string(19) "updatecustompricing" ["args"]=> array(2) { [0]=>
> &string(14) "/tmp/php7TxSi7" [1]=> &string(1) "2" } } [3]=> array(4)
> { ["file"]=> string(66) "/usr/local/apache2/htdocs/refillingstation/
> admin/accesscontrol.php" ["line"]=> int(58) ["args"]=> array(1)
> { [0]=> string(96) "/usr/local/apache2/htdocs/refillingstation/admin/
> custom_prices/import_custom_prices_response.php" } ["function"]=>
> string(7) "include" } }

Assuming you are outputting to a browser...you could always do:
echo "<pre>";
var_dump(debug_backtrace());
echo "</pre>";

That should work...

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация