I don't understand why you do this. Why isn't the following sufficient?

```php
public function biasedInteger($min, $max, $function)
{
    return floor($function(mt_rand(0,1)) * ($max - $min + 1) + $min);
}
```