PHPackages                             felideo/debug2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. felideo/debug2

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

felideo/debug2
==============

Debug2 is a function developed to debug PHP code of form easy, simple, pretty print, fast and safe.

v2.0.5(1y ago)06021MITPHP

Since Jul 21Pushed 1y agoCompare

[ Source](https://github.com/felideo/debug2)[ Packagist](https://packagist.org/packages/felideo/debug2)[ RSS](/packages/felideo-debug2/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (8)DependenciesVersions (17)Used By (1)

Debug2
======

[](#debug2)

[![Latest Stable Version](https://camo.githubusercontent.com/86b22fcbc8ddd25ee609da9cce3c780339dc7c3661ae14474168abd707649084/68747470733a2f2f706f7365722e707567782e6f72672f66656c6964656f2f6465627567322f76657273696f6e)](https://packagist.org/packages/felideo/debug2)[![License](https://camo.githubusercontent.com/36eff04c3790d09e82cb4b6a0e49b2b9defa7d12ec9465f555faec178027fab1/68747470733a2f2f706f7365722e707567782e6f72672f66656c6964656f2f6465627567322f6c6963656e73652e737667)](https://packagist.org/packages/felideo/debug2)

Debug2 is a package developed to debug PHP code of form easy, simple, pretty print, fast, and safe. It's made to be a global function on the entire project for fast calls with a simple **function($variable)**, without lost time typing a lot of keys with unnecessary namespace, class, and methods to instantiate a class, call a static function, or any irritant thing like that, when all you want is see or find something very fast.

The functions include a backtrace to the fast and exact location where the function is called. Because If you put an **exit** or **die** inside your code and forget to remove it, you never more will find!

Finally debug2 print your code perfectly formatted and not a lot of crap, hard to read and understand like this:

```
Array ( [Animalia] => Array ( [Chordata] => Array ( [mamalia] => Array ( [0] => cat [1] => dog [2] => human ) [aves] => Array ( [0] => Ostrich [1] => chicken ) ) ) )

```

How to use
==========

[](#how-to-use)

- **Install** =&gt; composer require felideo/debug2
- **Functions** =&gt; debug1, debug2, reflect

Description
===========

[](#description)

### Debug1 and debug2

[](#debug1-and-debug2)

The unique difference between debug1 and debug2 it's that on debug1 the backtrace is limited to 3 entries and debug2 shows a full backtrace.

```
debug1(
	mixed  $debug,
	?string  $title,
	?string  $exit
): void

debug2(
	mixed  $debug,
	?string  $title,
	?string  $exit
): void

```

#### Example

[](#example)

```
