| 1 |
# Kint - debugging helper for PHP developers |
| 2 |
|
| 3 |
[](https://packagist.org/packages/raveren/kint](https://packagist.org/packages/raveren/kint](https://packagist.org/packages/raveren/kint) |
| 4 |
|
| 5 |
http://raveren.github.com/kint/ |
| 6 |
|
| 7 |
 |
| 8 |
|
| 9 |
Kint for PHP is a powerful and modern, zero-setup replacement for **[](http://php.net/manual/en/function.var-dump.phpvar_dump()](http://php.net/manual/en/function.var-dump.php](http://php.net/manual/en/function.var-dump.php)**, **[](http://php.net/manual/en/function.print-r.phpprint_r()](http://php.net/manual/en/function.print-r.php](http://php.net/manual/en/function.print-r.php)** and **[](http://php.net/manual/en/function.debug-backtrace.phpdebug_backtrace()](http://php.net/manual/en/function.debug-backtrace.php](http://php.net/manual/en/function.debug-backtrace.php)**. You'll wonder how you developed without it. |
| 10 |
|
| 11 |
|
| 12 |
---- |
| 13 |
|
| 14 |
|
| 15 |
## Installation and usage |
| 16 |
```php |
| 17 |
<?php |
| 18 |
require '/kint/Kint.class.php'; |
| 19 |
``` |
| 20 |
|
| 21 |
**Or, if you use Composer:** |
| 22 |
|
| 23 |
```json |
| 24 |
"require": { |
| 25 |
... |
| 26 |
"raveren/kint": "v0.9" |
| 27 |
} |
| 28 |
``` |
| 29 |
|
| 30 |
**That's it, you can now use Kint to debug your code:** |
| 31 |
|
| 32 |
```php |
| 33 |
<?php |
| 34 |
########## DUMP VARIABLE ########################### |
| 35 |
Kint::dump($GLOBALS, $_SERVER); // any number of parameters |
| 36 |
// or simply use d() as a shorthand: |
| 37 |
d($_SERVER); |
| 38 |
|
| 39 |
|
| 40 |
########## DEBUG BACKTRACE ######################### |
| 41 |
Kint::trace(); |
| 42 |
// or via shorthand: |
| 43 |
d(1); |
| 44 |
|
| 45 |
|
| 46 |
########## TEXT-ONLY OUTPUT ######################## |
| 47 |
s($GLOBALS); |
| 48 |
|
| 49 |
|
| 50 |
########## MISCELLANEOUS ########################### |
| 51 |
// to disable all output |
| 52 |
Kint::enabled(false); |
| 53 |
// further calls, this one included, will not yield any output |
| 54 |
d('Get off my lawn!'); // no effect |
| 55 |
|
| 56 |
``` |
| 57 |
|
| 58 |
### Furthermore |
| 59 |
|
| 60 |
* `sd()` and `dd()` are shorthands for `s();die;` and `d();die;` respectively. |
| 61 |
* `!Kint::dump()` and `!dd()` will display the dump expanded by default. |
| 62 |
* `@Kint::dump()` and `@d()` will return the output instead of displaying it. |
| 63 |
|
| 64 |
---- |
| 65 |
|
| 66 |
|
| 67 |
[](http://raveren.github.com/kint/Visit the project page](http://raveren.github.com/kint/](http://raveren.github.com/kint/) for documentation, configuration, and more advanced usage examples. |
| 68 |
|
| 69 |
### Author |
| 70 |
|
| 71 |
**Rokas Šleinius** (Raveren) |
| 72 |
|
| 73 |
 |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
#### Contributing |
| 78 |
|
| 79 |
I'd really appreciate it if you forked the wip branch when introducing changes. Currently it's located here: |
| 80 |
|
| 81 |
https://github.com/raveren/kint/tree/1.0.0-wip |
| 82 |
|
| 83 |
The stable `master` branch is usually behind and is updated rarely in big batches of tested functionality. |
| 84 |
|
| 85 |
|
| 86 |
#### License |
| 87 |
|
| 88 |
Licensed under the MIT License |
| 89 |
|