From 895888bb15fbeb880a04a985ff181ddceda43029 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 12 Aug 2016 16:11:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0halt=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E7=94=A8=E4=BA=8E=E5=8F=98=E9=87=8F=E8=B0=83=E8=AF=95=E5=B9=B6?= =?UTF-8?q?=E4=B8=AD=E6=96=AD=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helper.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/helper.php b/helper.php index f2fd20cb..8bce6e92 100644 --- a/helper.php +++ b/helper.php @@ -511,3 +511,15 @@ if (!function_exists('abort')) { } } } + +if (!function_exists('halt')) { + /** + * 调试变量并且中断输出 + * @param mixed $var 调试变量或者信息 + */ + function halt($var) + { + dump($var); + throw new \think\exception\HttpResponseException(new Response); + } +}