martinlindhe/php-debughelper
最新稳定版本:0.1.17
Composer 安装命令:
composer require martinlindhe/php-debughelper
包简介
README 文档
README
https://packagist.org/packages/martinlindhe/php-debughelper
Installation
With Composer
composer require martinlindhe/php-debughelper
or add manually to composer.json:
{
"require": {
"martinlindhe/php-debughelper": "~0.1"
}
}
HexPrinter
use DebugHelper\HexPrinter; echo HexPrinter::render("\xF0\xFF\x00");
will output something like
000000: f0 ff 00 ...
BinaryPrinter
use DebugHelper\BinaryPrinter; echo BinaryPrinter::render("\xF0\xFF\x00");
will output something like
000000: 11110000 11111111 00000000 ...
Stopwatch
use DebugHelper\Stopwatch; $watch = new Stopwatch; $watch->start(); // do some heavy lifting ... $watch->stop(); echo $watch->getElapsedTime()." seconds elapsed\n";
Logging
dbg($msg); // write to stdout if DEBUG=1
nfo($msg);
err($msg);
dbgTime($msg);
nfoTime($msg);
errTime($msg);
Helpers
d() dumps variable, using symfony/var-dumper
dd() dump and die
bt($ex = null) prints a backtrace (optionally from exception)
dh() shorthand for DebugHelper\HexPrinter::render()
dbits() shorthand for DebugHelper\BinaryPrinter::render()
dm() prints current memory usage
apcm() prints memory usage by the apc extension
统计信息
- 总下载量: 354
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 6
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-16