Skip to content

Commit 8850221

Browse files
committed
Add echot for debugging
1 parent be00429 commit 8850221

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

bootstrap.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,24 @@
2727
* @param mixed $param
2828
*/
2929
function debug($param) {
30-
if($param === true || $param === false || $param === null || $param === ''){
30+
if ($param === true || $param === false || $param === null || $param === '') {
3131
var_dump($param);
3232
}
3333
print_r($param);
3434
}
3535

36+
/**
37+
* Same as echo but it will add a timestamp and new line
38+
*
39+
* @param string $str
40+
* @return void
41+
*/
42+
function echot(string $str) {
43+
printf(
44+
'[%s] %s%s',
45+
date('d.m.Y H:i:s'),
46+
$str,
47+
PHP_EOL
48+
);
49+
}
50+

0 commit comments

Comments
 (0)