2017 © Pedro Peláez
 

library debug-die

Convenience wrapper around var_dump() and die(var_dump())

image

jeremykendall/debug-die

Convenience wrapper around var_dump() and die(var_dump())

  • Monday, January 12, 2015
  • by jeremykendall
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6,705 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 7 % Grown

The README.md

Debug Helper

Debug Helper is a set of convenience functions that wrap var_dump() and die(var_dump()). Because lazy., (*1)

Installation

Use Composer to install Debug Helper., (*2)

{
    "require": {
        "jeremykendall/debug-die": "*"
    }
}

d() and dd()

d() and dd() wrap var_dump() and die(var_dump()), respectively. Both functions use the same method signature as [var_dump()][4], meaning you can pass more than one argument to the functions and each argument will be dumped individually., (*3)

void d ( mixed $expression [, mixed $... ] ) void dd ( mixed $expression [, mixed $... ] ), (*4)

An example usage is available in example.php., (*5)

<?php

require_once './vendor/autoload.php';

$one = array('one', 'two', 'three');
$two = 'String argument';

d('debug', $one, $two);

dd('debug and die', $one, $two);

echo "You'll never see me.";

The example can be executed from the command line:, (*6)

$ php -f example.php
string(5) "debug"
array(3) {
    [0] =>
        string(3) "one"
        [1] =>
        string(3) "two"
        [2] =>
        string(5) "three"
}
string(15) "String argument"
string(13) "debug and die"
array(3) {
    [0] =>
        string(3) "one"
        [1] =>
        string(3) "two"
        [2] =>
        string(5) "three"
}
string(15) "String argument"

Recommendation

Do you even Xdebug?, (*7)

In my opinion, var_dump() is best used in concert with Xdebug. You should be using Xdebug in development anyhow, so go install it now. NOW., (*8)

The Versions

12/01 2015

dev-master

9999999-dev https://github.com/jeremykendall/debug-die

Convenience wrapper around var_dump() and die(var_dump())

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

helper debugging helper function convenience function

12/01 2015

0.0.1

0.0.1.0 https://github.com/jeremykendall/debug-die

Convenience wrapper around var_dump() and die(var_dump())

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

helper debugging helper function convenience function