Conditions | 5 |
Paths | 7 |
Total Lines | 20 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
35 | function dr() |
||
36 | { |
||
37 | $args = func_get_args(); |
||
38 | $result = ''; |
||
39 | foreach ($args as $arg) { |
||
40 | $result = ''; |
||
41 | $type = gettype($arg); |
||
42 | if ($type == 'object') { |
||
43 | $type = get_class($arg); |
||
44 | } |
||
45 | if ($type == 'boolean') { |
||
46 | $result = $arg ? 'true' : 'false'; |
||
47 | } else { |
||
48 | $result = print_r($arg, true); |
||
49 | } |
||
50 | $result = sprintf('(%s) %s', $type, $result); |
||
51 | } |
||
52 | |||
53 | return $result; |
||
54 | } |
||
55 | } |
||
71 |
Even though PHP does not care about the name of your methods, it is generally a good practice to choose method names which can be easily understood by other human readers.