note 123723 added to debugger
| From: | tekintian at gmail dot com | Date: | Sun, 24 Mar 2019 12:07:09 +0000 |
| Subject: | note 123723 added to debugger | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-210453@lists.php.net to get a copy of this message | ||
<?php
/**
* æµè¯æå°æ¹æ³
* @FileName: test_helper.php
* @Author: TekinTian
* @QQ: 3316872019
* @Email: tekintian@gmail.com
* @Supported: http://dev.yunnan.ws/
* @Date: 2017-01-23 11:45:26
* @Last Modified 2019-03-04
*/
if (!function_exists('dd')) {
/**
* æµè¯æå°å½æ°
* @param [type] $arr [description]
* @return [type] [description]
*/
function dd($arr) {
if (is_array($arr)) {
echo "<pre>";
print_r($arr);
echo "</pre>";
} else if (is_object($arr)) {
echo "<pre>";
print_r($arr);
echo "</pre>";
} else {
echo $arr;
}
die;
}
}
if (!function_exists('pp')) {
/**
* æ ¼å¼åè¾åº
* @param [type] $arr [description]
* @return [type] [description]
*/
function pp($arr) {
if (is_array($arr)) {
echo "<pre>";
print_r($arr);
echo "</pre>";
} else if (is_object($arr)) {
echo "<pre>";
print_r($arr);
echo "</pre>";
} else {
echo $arr;
}
die;
}
}
if (!function_exists('pr')) {
/**
* æå°ä¸ä¸æ
*/
function pr($arr) {
if (is_array($arr)) {
echo "<pre>";
print_r($arr);
echo "</pre>";
} else if (is_object($arr)) {
echo "<pre>";
print_r($arr);
echo "</pre>";
} else {
echo $arr;
}
}
}
if (!function_exists('vd')) {
/**
* æµè¯æå°å½æ°
* @param [type] $arr [description]
* @return [type] [description]
*/
function vd($arr) {
echo "<pre>";
var_dump($arr);
echo "</pre>";
die;
}
}
if (!function_exists('vv')) {
function vv($arr) {
echo "<pre>";
var_dump($arr);
echo "</pre>";
}
}
if (!function_exists('console_log')) {
/**
* console.logæ§å¶å°è°è¯å½æ°
* @param [type] $data [è¦å¨æ§å¶å°è¾åºçæ°æ®
æ¯ææ°ç»ã对象åå符串]
* @return [type] [description]
*/
function console_log($data) {
if (is_array($data) || is_object($data)) {
echo ("<script>console.log('" . json_encode($data) .
"');</script>");
} else {
echo ("<script>console.log('" . $data .
"');</script>");
}
}
}
/**
*
æµè§å¨å好çåéè¾åº,便äºè°è¯æ¶å使ç¨
*
* @param mixed $var è¦è¾åºæ¥ççå
容
* @param bool $echo æ¯å¦ç´æ¥è¾åº
* @param string $label
å ä¸è¯´ææ ç¾,妿æ,è¿æ¾ç¤º"æ ç¾å:"è¿ç§å½¢å¼
* @param bool $strict æ¯å¦ä¸¥æ ¼è¿æ»¤
* @return string
*/
if (!function_exists('dump')) {
function dump($var, $echo = true, $label = null, $strict = true) {
$label = ($label === null) ? '' : rtrim($label) . ' ';
if (!$strict) {
if (ini_get('html_errors')) {
$output = print_r($var, true);
$output = "<pre>" . $label . htmlspecialchars($output, ENT_QUOTES) .
"</pre>";
} else {
$output = $label . " : " . print_r($var, true);
}
} else {
ob_start();
var_dump($var);
$output = ob_get_clean();
if (!extension_loaded('xdebug')) {
$output = preg_replace("/\]\=\>\n(\s+)/m", "] => ", $output);
$output = '<pre>' . $label . htmlspecialchars($output, ENT_QUOTES) .
'</pre>';
}
}
if ($echo) {
echo ($output);
return null;
} else {
return $output;
}
}
}
----
Server IP: 208.43.231.9
Probable Submitter: 185.85.3.142 (proxied: 222.221.134.95)
----
Manual Page -- http://php.net/manual/en/debugger.php
Edit -- https://master.php.net/note/edit/123723
Del: integrated -- https://master.php.net/note/delete/123723/integrated
Del: useless -- https://master.php.net/note/delete/123723/useless
Del: bad code -- https://master.php.net/note/delete/123723/bad+code
Del: spam -- https://master.php.net/note/delete/123723/spam
Del: non-english -- https://master.php.net/note/delete/123723/non-english
Del: in docs -- https://master.php.net/note/delete/123723/in+docs
Del: other reasons-- https://master.php.net/note/delete/123723
Reject -- https://master.php.net/note/reject/123723
Search -- https://master.php.net/manage/user-notes.php