Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Tighten.co:
A better dd() for your TDD
Oct 13, 2016 @ 11:57:45

On the Tighten.co blog they have a recent post sharing a better dd() for your TDD - basically a better method for debugging the current state of object with a "dump and die" function.

An important part of every Laravel developer's debugging arsenal is the humble dd() helper function—"dump and die"—to output the contents of a variable and terminate execution of your code. In the browser, dd() results in a structured, easy-to-read tree, complete with little arrow buttons that can be clicked to expand or hide children of nested structures. In the terminal, however, it's a different story.

[...] Fortunately, it's simple to build your very own customized version of dd() to help tame your unwieldy terminal output—helping you find the details you're interested in quickly, without wearing out your trackpad (and your patience).

He provides two options you can use to help clean up the output of a "dump or die" method from the extensive results the current "dd" function provides:

Kint provides a few other helper methods you can use and easily configurable max and min depth to show in the output.

tagged: tdd testing vardumper kint library package output debugging

Link: https://blog.tighten.co/a-better-dd-for-your-tdd

Sameer Borate:
Easy PHP debugging with Kint
Nov 07, 2013 @ 11:24:02

Sameer Borate has posted about using Kint, a "more powerful debugger" that lets you output more data than just the usual var_dump or print_r provides and in a much more readable format.

My standard debugging tool when using PHP is xdebug. Pairing xdebug with Komodo gives me a very productive environment for building PHP applications. However, testing an application code on a hosted server can be many times frustrating as one has only the print_r and var_dump functions at our disposal. What I need is a library that I can easily install on the server and start using. Although there are a few debugging libraries around, one of my favorites is Kint.

He walks you through the installation of the tool and provides an example of the most basic usage (and output) from a call to the tool's "dump" function. He also gets into some of the additional features the library provides including intelligent formatting, debug tracing and limited theme configuration.

tagged: debug kint output printr vardump example setup

Link: http://www.codediesel.com/tools/easy-php-debugging-with-kint/

Project:
Kint - Advanced Output for Debugging
Jan 25, 2011 @ 08:16:09

One of the more difficult parts of development is debugging. Any tool that can help make your bug finding life simpler can be valuable. Raveren has submitted a new tool he's developed to make outputting your debugging information more useful - Kint.

It's basically a heavily improved var_dump and debug_backtrace version with some advanced behind the scenes action. The features description is in the google code page: http://code.google.com/p/kint/ but the interesting part is that this is the only dump tool, that can display the name of the dumped variable as well as use modifiers on the calling function.

The flow is traced back to its origin class/script and a token parser is used to find where the value was created. You can see a sample of how to use it over on its Google Code page. This also includes screenshots of the output and the configuration values you can set for things like a display path callback and the maximum number of levels to traverse through. You can download the current version here.

tagged: kint debugging output trace

Link: