for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
use Yiisoft\VarDumper\VarDumper;
if (!function_exists('d')) {
/**
* Prints variables.
*
* @param mixed ...$variables Variables to be dumped.
* @see \Yiisoft\VarDumper\VarDumper::dump()
* @psalm-suppress MixedAssignment
*/
function d(mixed ...$variables): void
{
$highlight = PHP_SAPI !== 'cli';
foreach ($variables as $variable) {
VarDumper::dump($variable, 10, $highlight);
echo $highlight ? '<br>' : PHP_EOL;
}
if (!function_exists('dd')) {
* Prints variables and terminate the current script.
function dd(mixed ...$variables): void
d(...$variables);
die(0);
exit
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.
if (!function_exists('dump')) {
* @see d()
function dump(mixed ...$variables): void
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.