Skip to content

Instantly share code, notes, and snippets.

@jkirira
Created April 20, 2026 03:57
Show Gist options
  • Select an option

  • Save jkirira/cc08559f06ac9f64c7b0ff62ea0e7b7a to your computer and use it in GitHub Desktop.

Select an option

Save jkirira/cc08559f06ac9f64c7b0ff62ea0e7b7a to your computer and use it in GitHub Desktop.
Die Dump (dd)
function ddd()
{
$args = func_get_args();
$defaultStringLength = -1;
$defaultItemNumber = -1;
$defaultDepth = -1;
foreach ($args as $variable) {
$dumper = 'cli' === PHP_SAPI ? new CliDumper() : new HtmlDumper();
$cloner = new VarCloner();
$cloner->setMaxString($defaultStringLength);
$cloner->setMaxItems($defaultItemNumber);
$dumper->dump($cloner->cloneVar($variable)->withMaxDepth($defaultDepth));
}
die(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment