📜 ⬆️ ⬇️

Krumo - helper to debug php code

Quite often, for debugging code, you have to look at the contents of variables, as a rule, for this you use commands such as echo, print_r (), var_dump (). But there is a lot of inconvenience, it happens that there are a lot of variables, it happens that we just don’t know which variables are used (for example, when parsing someone else’s code).
You can comb the inconvenience for a long time, here everyone gets out in their own way, someone writes their own functions, someone else invents something. Most recently, once again faced with such a problem, I found a psycho on me, the result is a day in Google, and the result is this simple Krumo class

The library is intelligent enough to understand what type of variable you passed (String, Array, Object, Class etc.) and itself carries out the appropriate conversion to the necessary html code for output in formatted form to your browser.

How does it work:
Download: on the official website
We connect:
include "class.krumo.php";

We use:
krumo($var);

Additional features:
// debug backgrace
krumo::backtrace();
//
krumo::includes();
//
krumo::functions();
//
krumo::classes();
//
krumo::defines();
//
krumo::disable();
//
krumo::includes();
//
krumo::enable();
//
krumo::classes();


Of course this is not a panacea, but it helps a lot, especially to understand other people's codes.

')

Source: https://habr.com/ru/post/47698/


All Articles