| Conditions | 5 |
| Paths | 6 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | function dd($data, $exit = false) |
||
| 33 | { |
||
| 34 | echo '<pre style="font-size:11px;">'; |
||
| 35 | |||
| 36 | if (is_array($data) || is_object($data)) { |
||
| 37 | echo htmlentities(print_r($data, true)); |
||
| 38 | } elseif (is_string($data)) { |
||
| 39 | echo "string(" . strlen($data) . ") \"" . htmlentities($data) . "\"\n"; |
||
| 40 | } else { |
||
| 41 | dd($data); |
||
| 42 | } |
||
| 43 | |||
| 44 | echo "\n</pre>"; |
||
| 45 | |||
| 46 | if ($exit) { |
||
| 47 | exit; |
||
|
|
|||
| 48 | } |
||
| 49 | } |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.