The `display_results` functions have a variable `$rids` which are declared as `bool` when they're most often `array`, sometimes `int`. The signature should probably be corrected to `array|int` and the default value an empty array. This then makes more sense when counting how many `$rids` there are for `$prtotal`.