PHPackages                             phpixie/debug - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. phpixie/debug

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

phpixie/debug
=============

Debugging library for PHPixie with support for logging and tracing

3.2(6y ago)221.8k↓100%11BSD-3-ClausePHP

Since Oct 11Pushed 6y ago1 watchersCompare

[ Source](https://github.com/PHPixie/Debug)[ Packagist](https://packagist.org/packages/phpixie/debug)[ Docs](http://phpixie.com)[ RSS](/packages/phpixie-debug/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (5)Used By (1)

Debug
=====

[](#debug)

[![Build Status](https://camo.githubusercontent.com/8f80d05e5016a662bd476263b3ed3dd5d36b1b49d6ff541be2aa603b5765e854/68747470733a2f2f7472617669732d63692e6f72672f504850697869652f44656275672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/PHPixie/Debug)[![Test Coverage](https://camo.githubusercontent.com/5fae94306848fcbba9f0fe6b1975d6955163253c30dbfab20186a7814c780410/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f504850697869652f44656275672f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/PHPixie/Debug)[![Code Climate](https://camo.githubusercontent.com/b050de64d84ed521b6f514a7df65e981f4e0ae577d0f45b603d0a94c2826c86f/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f504850697869652f44656275672f6261646765732f6770612e737667)](https://codeclimate.com/github/PHPixie/Debug)[![HHVM Status](https://camo.githubusercontent.com/7c14aebd4995dd4cd0270efb79a3095f11785f664906fa219c4fbdc956a5ff70/68747470733a2f2f696d672e736869656c64732e696f2f6868766d2f706870697869652f64656275672e7376673f7374796c653d666c61742d737175617265)](http://hhvm.h4cc.de/package/phpixie/debug)

[![Author](https://camo.githubusercontent.com/24a0a94bb83eb81ba03c32074967dc730174cfd2849e984169db461d955cdbb9/687474703a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d40647261636f6e792d626c75652e7376673f7374796c653d666c61742d737175617265)](https://twitter.com/dracony)[![Source Code](https://camo.githubusercontent.com/111e8e781be0d29014e594c372822e1eccbbe376e6b33a240857ea559465b3c7/687474703a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d706870697869652f64656275672d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/phpixie/debug)[![Software License](https://camo.githubusercontent.com/b60331a2084501dc07cf6d6964c0da58dd005d89c45cf3b28b4b22b60f5ec00f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4253442d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/phpixie/debug/blob/master/LICENSE)[![Total Downloads](https://camo.githubusercontent.com/44708e54f9586e5e1cd4d6a1614772974475a140509a624f58a1f1ef54118d3d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706870697869652f64656275672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpixie/debug)

PHPixie Debug was created to improve PHP development in any environment. Of course if you are already using a web framework debugging tools are already provided, but when developing a library, solving a programming puzzle or even using WordPress the lack of a debugging toolset is hindering. Even basic functionality like convertieng errors to exceptions requires registering a special handler. PHPixie Debug can bootstrap you with a convenient environment in just two lines of code.

**Exceptions and tracing**

The Debug library tries to achieve the same level of usage ina console environment as we already have in web applications. When writing libraries for PHPixie I often wanted to have exception traces that would include the part of code that the exception happened in. Another problem with traces in php is that calling *print\_r(debug\_backtrace())* directly can quickly result in a wall of text if any argument in the backtrace was an object with some dependencies. Using *debug\_print\_backtrace()* gives a better result, but still prints all array members and requires output buffering to assign the result to a variable. Let’s take a look at the PHPixie trace:

```
