Conditions | 7 |
Paths | 15 |
Total Lines | 32 |
Code Lines | 25 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
74 | public function __toString() |
||
75 | { |
||
76 | if ($this->isTerminal) { |
||
77 | $value = "<b>$this->classValue</b>"; |
||
78 | } else { |
||
79 | $value = $this->value; |
||
80 | $col = "col_$this->columnIndex"; |
||
81 | if (! preg_match("/^[<>=]{1,2}/", $value)) { |
||
82 | $value = "=$value"; |
||
83 | } |
||
84 | $value = "<b>$col $value</b><br>Gini: ". number_format($this->giniIndex, 2); |
||
85 | } |
||
86 | $str = "<table ><tr><td colspan=3 align=center style='border:1px solid;'> |
||
87 | $value</td></tr>"; |
||
88 | if ($this->leftLeaf || $this->rightLeaf) { |
||
89 | $str .='<tr>'; |
||
90 | if ($this->leftLeaf) { |
||
91 | $str .="<td valign=top><b>| Yes</b><br>$this->leftLeaf</td>"; |
||
92 | } else { |
||
93 | $str .='<td></td>'; |
||
94 | } |
||
95 | $str .='<td> </td>'; |
||
96 | if ($this->rightLeaf) { |
||
97 | $str .="<td valign=top align=right><b>No |</b><br>$this->rightLeaf</td>"; |
||
98 | } else { |
||
99 | $str .='<td></td>'; |
||
100 | } |
||
101 | $str .= '</tr>'; |
||
102 | } |
||
103 | $str .= '</table>'; |
||
104 | return $str; |
||
105 | } |
||
106 | } |
||
107 |
On one hand,
eval
might be exploited by malicious users if they somehow manage to inject dynamic content. On the other hand, with the emergence of faster PHP runtimes like the HHVM,eval
prevents some optimization that they perform.