定制 jeremykendall/debug-die 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jeremykendall/debug-die

最新稳定版本:0.0.1

Composer 安装命令:

composer require jeremykendall/debug-die

包简介

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

README 文档

README

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

Installation

Use Composer to install Debug Helper.

{
    "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(), meaning you can pass more than one argument to the functions and each argument will be dumped individually.

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

An example usage is available in example.php.

<?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:

$ 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?

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.

统计信息

  • 总下载量: 7.61k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-12