From 4cd0e9692fec656744710d27f18a53957ec48a40 Mon Sep 17 00:00:00 2001 From: ADmad Date: Sat, 7 Jan 2017 20:19:28 +0530 Subject: [PATCH] Make location displayed by dd() identical to that by debug(). Refs #9989 --- src/basics.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/basics.php b/src/basics.php index 0baedc2bc0f..cd6008c8d2c 100644 --- a/src/basics.php +++ b/src/basics.php @@ -51,7 +51,10 @@ function debug($var, $showHtml = null, $showFrom = true) $line = ''; $lineInfo = ''; if ($showFrom) { - $trace = Debugger::trace(['start' => 1, 'depth' => 2, 'format' => 'array']); + $trace = Debugger::trace(['start' => 1, 'depth' => 3, 'format' => 'array']); + if (count($trace) > 1) { + array_shift($trace); + } $search = []; if (defined('ROOT')) { $search = [ROOT]; @@ -171,8 +174,6 @@ function dd($var, $showHtml = null) } debug($var, $showHtml, false); - $backtrace = debug_backtrace(false, 1); - pr('dd-location: ' . $backtrace[0]['file'] . ':' . $backtrace[0]['line']); die(1); } }