northrook / php-debug
Dump and debug PHP
dev-main
2026-08-07 13:28 UTC
Requires
- php: >=8.5
- ext-mbstring: *
- northrook/ansi-formatter: dev-main
- northrook/core-contracts: dev-main
- northrook/inline-styles: dev-main
Requires (Dev)
- ext-pdo: *
- northrook/php-cs: dev-main
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^13
This package is auto-updated.
Last update: 2026-08-07 12:29:02 UTC
README
Variable dump + call-origin / source-pane engine for Northrook packages.
Usage
use Northrook\Debug;
use Northrook\Debug\SourceView;
use Northrook\Debug\VarDumper;
$dump = Debug::this(
user: $user,
cart: $cart,
);
echo $dump->html(); // web
echo $dump->cli(); // terminal (ansi-formatter)
$dump->print(); // SAPI-aware echo
Named arguments become dump labels. Positional arguments use index labels.
// Instance dumper (stores results; does not emit)
$dumper = new VarDumper();
$dumper->dump(user: $user);
$dumper->last()?->print();
// Source pane for exception frames / error-handler
echo new SourceView(file: $path, line: $line);
Notes
- No global
dump()/dd()in this package. - HTML is JS-free (checkbox toggles + embedded CSS).
- Secrets: default key names (
password,token, …),#[Secret],@secret,SensitiveParameter. Debug::now()/deferred()/queue()are stubs (throw until the timing handler exists).- Shared config lives on
Northrook\Debugger(DebugConfig); per-instance options onVarDumper.
Dev
composer test
composer phpstan
php index.php # CLI playground
# or open index.php in a browser