northrook/php-debug

Dump and debug PHP

Maintainers

Package info

codeberg.org/northrook/php-debug

Issues

pkg:composer/northrook/php-debug

Transparency log

Statistics

Installs: 11

Dependents: 2

Suggesters: 0

dev-main 2026-07-16 13:10 UTC

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 on VarDumper.

Dev

composer test
composer phpstan
php index.php          # CLI playground
# or open index.php in a browser