Conditions | 5 |
Paths | 5 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
61 | public static function ifdef(array $needle, array $haystack, $value) |
||
62 | { |
||
63 | $key = array_shift($needle); |
||
64 | |||
65 | do |
||
66 | { |
||
67 | if (array_key_exists($key, $haystack)) |
||
68 | $haystack = $haystack[$key]; |
||
69 | else |
||
70 | return $value; |
||
71 | |||
72 | $key = count($needle) ? array_shift($needle) : NULL; |
||
73 | |||
74 | if (is_null($key)) |
||
75 | return $haystack; |
||
76 | |||
79 | } |