So you’re a PHP developer, huh!? Well then you must be using var_dump or print_r. Well I’m going to show you that using them should go in history because there’s new kid in the block and his name is Kint.

Kint is nothing but a debugging tool for PHP based projects. I have experience in using Kint only in Symfony2 projects. In Symfony2 projects you just add "raveren/kint": "1.0.*@dev" to your composer.json and update it.

You don’t have to worry about including Kint in any of the files because composer will autoload it.

To debug a variable you simply write dd($someVar)

Kint_1

You’ll get a nice visual representation of your variable. But you might say hey I can do that with var_dump as well. It’s not pretty but I get things done.

Vardump

Well wrong, have you ever used var_dump on an object? You’re still waiting for it load?

Kint doesn’t have such problem. Let’s see what happens when you debug an object using Kint.

Kint_2

Kint also comes with nice set of features. If you prepend dd with ! you’ll get already expanded data

!dd($someVar)

Also you don’t have to worry about using die(); function because your code will automatically be halted when you use kint with two d’s. If you want to prevent that option you should use only one d. It goes like this

d($someVar)

To read more about kint check their official website kint