Skip to content

Commit bd5a302

Browse files
committed
feature #53123 [VarDumper] Added default message for dd function (Shamimul Alam)
This PR was squashed before being merged into the 7.1 branch. Discussion ---------- [VarDumper] Added default message for dd function | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | | License | MIT This will facilitate writing empty dd() statements during unorthodox debugging in the code. It will be helpful for both novice and experienced developers. Commits ------- 857db8f0af [VarDumper] Added default message for dd function
2 parents aa67d51 + 654cb58 commit bd5a302

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Resources/functions/dump.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ function dd(mixed ...$vars): never
4949
header('HTTP/1.1 500 Internal Server Error');
5050
}
5151

52+
if (!$vars) {
53+
VarDumper::dump(new ScalarStub('🐛'));
54+
55+
exit(1);
56+
}
57+
5258
if (array_key_exists(0, $vars) && 1 === count($vars)) {
5359
VarDumper::dump($vars[0]);
5460
} else {

0 commit comments

Comments
 (0)