Re: Debuggin PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Robert Cummings wrote:
On Wed, 2006-04-26 at 12:44, Jochem Maas wrote:

hicham wrote:


easy way 2:
	use lots of echo()/var_dump()/print_r() in your code to figure out
	where it's breaking.


If you're trying to track down an error using this technique (by far one
of the most popular techniques and time tested), be sure and use your
knowledge of binary search algorithms to speed up your search. Applying
the heuristic of guessing approximately where it's occurring will help

that'll be the old 'put the first debug "echo" in the "middle" of the
script" technique :-)

you greatly also :) This kind of technique though is mostly only
necessary when PHP does something stupid like segfault *grin*. Another
fantastic technique is if you know the error occurs at a specific
location, but don't know how the heck the script got there... you can
use debug_backtrace().

very good tips!


Cheers,
Rob.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux