1 | <?php |
||
2 | |||
3 | function sd() |
||
4 | { |
||
5 | $Args = func_get_args(); |
||
6 | $console = new \PhpConsoleColor\Console(); |
||
7 | |||
8 | foreach ($Args as $str) { |
||
9 | $str = print_r($str, true); |
||
10 | $console->writeLn("<green>$str</green>"); |
||
11 | } |
||
12 | $bt = debug_backtrace(); |
||
13 | $caller = array_shift($bt); |
||
14 | $console->writeLn("<blue>".$caller['file'].":".$caller['line']."<blue>"); |
||
15 | |||
16 | die(); |
||
0 ignored issues
–
show
|
|||
17 | } |
||
18 | |||
19 | |||
20 | function s() |
||
21 | { |
||
22 | $Args = func_get_args(); |
||
23 | $console = new \PhpConsoleColor\Console(); |
||
24 | |||
25 | foreach ($Args as $str) { |
||
26 | $str = print_r($str, true); |
||
27 | $console->writeLn("<green>$str</green>"); |
||
28 | } |
||
29 | $bt = debug_backtrace(); |
||
30 | $caller = array_shift($bt); |
||
31 | $console->writeLn("<blue>".$caller['file'].":".$caller['line']."<blue>"); |
||
32 | } |
||
33 |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.