northrook / php-debug
Dump and debug PHP
dev-main
2026-07-16 13:10 UTC
Requires
- php: >=8.4
- northrook/ansi-formatter: @dev
- northrook/core-contracts: @dev
- northrook/hasher: @dev
- northrook/inline-styles: @dev
Requires (Dev)
- ext-pdo: *
- northrook/php-cs: @dev
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^11.0
This package is auto-updated.
Last update: 2026-07-16 12:10:13 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