This is clearly wrong. The original intention here was a to carry out a small optimisation.
So, if we have two or more different entries in $types, then their is no need to do further search (it's sufficient for the if/else statement further below).

The code should be something like this: 

```
if(sizeof($types) > 1) break;
```