PHPackages                             sanderheijselaar/ezdebug - 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. sanderheijselaar/ezdebug

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

sanderheijselaar/ezdebug
========================

A simple set of functions for PHP debugging

0.1.3(7y ago)044MITPHP

Since Dec 16Pushed 7y ago1 watchersCompare

[ Source](https://github.com/sanderheijselaar/ezdebug)[ Packagist](https://packagist.org/packages/sanderheijselaar/ezdebug)[ RSS](/packages/sanderheijselaar-ezdebug/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

\#EZ DEBUG For easy debugging without x-debug. Works both in the browser aswel as in the terminal.

\##Installation Install the composer package () or download and include the ezDebug.php file in your project

\##Quick usage

```
$data1 = array(
    'id' => 1,
    'name' => 'Sander Heijselaar',
    'country' => 'NL'
);

pr($data1, 'Array dump with pr');

```

Which will output the following:

[![Alt text](raw/img/first-example.png?raw=true "First example")](raw/img/first-example.png?raw=true)

As you can see the data is dumped on screen and when you hover on a dump, it will tell you where the location of this dump is. This way you'll never have to search though your code to find all debug lines.

\##Usage with the Class

The same can be achieved by using the class

```
use SanderHeijselaar\EzDebug\EzDebug;

$data1 = array(
    'id' => 1,
    'name' => 'Sander Heijselaar',
    'country' => 'NL'
);

EzDebug::pr($data1, 'Array dump with pr');

```

All methods, except for prdiff &amp; prdiffx will also work on the CLI.

[![Alt text](raw/img/first-cli-example.png?raw=true "First example")](raw/img/first-cli-example.png?raw=true)

\##Methods

Below is a list of the available methods that are at your disposal.

For almost every method there's method with the same name with an x behind it. This method will do exactly the same as the method without the x but will also exit at the end of the method.

The same applies for methods that end with an extra d at the end. Those methods do the same thing as the method without the d but will flush the output at the end of the method.

\###Arguments Almost every method has the same arguments, for example:

```
pr($data, $label = '', $bgcolor = '', $color = '')

```

- $data is the data that needs to be dumped
- $label is the optional label that's shown on top of the data
- $bgcolor is the optional background color. See all the available colors below
- $color is the optional text color. See all the available colors below

\###pr, prd &amp; prx **pr**int the debug data on the screen using print\_r

```
pr($data, $label = '', $bgcolor = '', $color = '')

```

[![Alt text](raw/img/pr-example.png?raw=true "pr, prd & prx example")](raw/img/pr-example.png?raw=true)

\###prv, prvd &amp; prvx print the debug data on the screen using **v**ar\_export

```
prv($data, $label = '', $bgcolor = '', $color = '')

```

[![Alt text](raw/img/prv-example.png?raw=true "prv, prvd & prvx example")](raw/img/prv-example.png?raw=true)

\###prhe &amp; prhex print the debug data on the screen using **h**tml**e**ntities

```
prhe($data, $label = '', $bgcolor = '', $color = '')

```

[![Alt text](raw/img/prhe-example.png?raw=true "prhe & prhex example")](raw/img/prhe-example.png?raw=true)

\###prbt &amp; prbtx print the backtrace on the screen using debug\_backtrace()

```
prbt($format = '', $label = '', $bgcolor = '', $color = '')

```

The format is eighter EzDebug::BtFormatFull EzDebug::BtFormatCompact. The compact option is default. [![Alt text](raw/img/prbt-example.png?raw=true "prbt & prbtx example")](raw/img/prbt-example.png?raw=true)

\###prg &amp; prgx print the $\_GET var on the screen

```
prg($label = '', $bgcolor = '', $color = '')

```

There's no $data parameter because this method is dedicated to the use the $\_GET as the $data. When no $label is provided, '\_\_GET' will be displayed.

[![Alt text](raw/img/prg-example.png?raw=true "prg & prgx example")](raw/img/prg-example.png?raw=true)

\###prp &amp; prpx print the $\_POST var on the screen

```
prp($label = '', $bgcolor = '', $color = '')

```

There's no $data parameter because this method is dedicated to the use the $\_POST as the $data. When no $label is provided, '\_\_POST' will be displayed.

[![Alt text](raw/img/prp-example.png?raw=true "prp & prpx example")](raw/img/prp-example.png?raw=true)

\###prs &amp; prsx print the $\_SESSION var on the screen

```
prs($label = '', $bgcolor = '', $color = '')

```

There's no $data parameter because this method is dedicated to the use the $\_SESSION as the $data. When no $label is provided, '\_\_SESSION' will be displayed.

[![Alt text](raw/img/prs-example.png?raw=true "prs & prsx example")](raw/img/prs-example.png?raw=true)

\###prc &amp; prcx print the $\_COOKIE var on the screen

```
prc($label = '', $bgcolor = '', $color = '')

```

There's no $data parameter because this method is dedicated to the use the $\_COOKIE as the $data. When no $label is provided, '\_\_COOKIE' will be displayed.

[![Alt text](raw/img/prc-example.png?raw=true "prc & prcx example")](raw/img/prc-example.png?raw=true)

\###prf &amp; prfx print the $\_FILES var on the screen

```
prf($label = '', $bgcolor = '', $color = '')

```

There's no $data parameter because this method is dedicated to the use the $\_FILES as the $data. When no $label is provided, '\_\_FILES' will be displayed.

[![Alt text](raw/img/prf-example.png?raw=true "prf & prfx example")](raw/img/prf-example.png?raw=true)

\###prsvr &amp; prsvrx print the $\_SERVER var on the screen

```
prf($label = '', $bgcolor = '', $color = '')

```

There's no $data parameter because this method is dedicated to the use the $\_SERVER as the $data. When no $label is provided, '\_\_SERVER' will be displayed.

\###prxml, prxmld &amp; prxmlx print formatted XML on the screen

```
prxml(
    "ToveJaniReminderDon't forget me this weekend!",
    $label = '',
    $bgcolor = '',
    $color = ''
);

```

[![Alt text](raw/img/prxml-example.png?raw=true "prxml, prxmld & prxmlx example")](raw/img/prxml-example.png?raw=true)

\###prta &amp; prtax \*pr**int the debug data on the screen using a &lt; text**a\*\*rea &gt;

```
prta($data, $label = '', $bgcolor = '', $color = '')

```

[![Alt text](raw/img/prta-example.png?raw=true "prta & prtax example")](raw/img/prta-example.png?raw=true)

\###prl, prld &amp; prlx \*pr\*\*int the current **l**ine on the screen

```
prta($data, $label = '', $bgcolor = '', $color = '')

```

[![Alt text](raw/img/prl-example.png?raw=true "prl, prld & prlx example")](raw/img/prl-example.png?raw=true)

\###prfile &amp; prfilea \*pr\*\*int the data to a **file** instead of the screen. prfile will clear the file before writing the data to it. prfilea will append the dato the bottom of the file.

```
prfile($filename, $data)

```

[![Alt text](raw/img/prfile-example.png?raw=true "prl, prld & prlx example")](raw/img/prfile-example.png?raw=true)

\###prdiff &amp; prdiffx

```
prdiff($data1, $data2)

```

[![Alt text](raw/img/prdiff-example.png?raw=true "prl, prld & prlx example")](raw/img/prdiff-example.png?raw=true)

\##Colors To distinguish the dumps when you have a screen filled with them, it's possible to pass any background and/or foreground color. My most used colors are:

[![Alt text](raw/img/selectedColors.png?raw=true "All colors")](raw/img/selectedColors.png?raw=true)

```
EzDebug::prd('EzDebug::C' . EzDebug::CLightGreen, 'OK', EzDebug::CLightGreen);
EzDebug::prd('EzDebug::C' . EzDebug::COrange, 'NOTIFICATION', EzDebug::COrange);
EzDebug::prd('EzDebug::C' . EzDebug::CLightCoral, 'ERROR', EzDebug::CLightCoral);

```

You can use the pre defined colors, but any other color code (#fff or green) will work.

\###All available colors There are alot of predefined colors in the class

```
EzDebug::prcolors();

```

[![Alt text](raw/img/allColors.png?raw=true "All colors")](raw/img/allColors.png?raw=true)

\##Acknowledgements

- I'm using Stephen Morley's Diff Class, which you can find more about at

**Licensed under MIT**

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~312 days

Total

4

Last Release

2859d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2448c74415930663c076b78b5e81eec428c3d0abb6aa04724fe2cb84663f1cda?d=identicon)[sheijselaar](/maintainers/sheijselaar)

---

Top Contributors

[![sanderheijselaar](https://avatars.githubusercontent.com/u/2115388?v=4)](https://github.com/sanderheijselaar "sanderheijselaar (5 commits)")

---

Tags

phpdebug

### Embed Badge

![Health badge](/badges/sanderheijselaar-ezdebug/health.svg)

```
[![Health](https://phpackages.com/badges/sanderheijselaar-ezdebug/health.svg)](https://phpackages.com/packages/sanderheijselaar-ezdebug)
```

###  Alternatives

[jbzoo/jbdump

Script for debug and dump PHP variables and other stuff. This tool is a nice replacement for print\_r() and var\_dump() functions.

211.1M3](/packages/jbzoo-jbdump)[swoft/devtool

Devtool for swoft framework

26154.1k5](/packages/swoft-devtool)[h4cc/phpqatools

A meta composer package for PHP QA Tools.

6418.6k1](/packages/h4cc-phpqatools)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
