Replies: 0
In motorracingleaguescoring.php line #50, comparison “$key == 0” :
if ($options->get_predict_pole() && $key == 0 && isset($drivers[0]) && $guess == $drivers[0]['id']) {
Your use of ‘==’ causes PHP’s type coercion to cast string values of $key to be the integer 0, meaning that conditional can be satisfied with values like “rain” or “safety_car”, leading to extra pole position prediction points being erroneously added.
Top tip: Always use ‘===’ to guarantee type safe comparisons. 🙂
- This topic was modified 15 minutes ago by abulia.