From 99576c9ad38763b8f10e6b03a9cff1ce32604869 Mon Sep 17 00:00:00 2001 From: goat1000 Date: Tue, 25 Apr 2023 09:27:40 +0100 Subject: [PATCH] Fix compatibility with PHP 7.2. --- BestFitCurve.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BestFitCurve.php b/BestFitCurve.php index 17f8771..8e4005a 100644 --- a/BestFitCurve.php +++ b/BestFitCurve.php @@ -99,7 +99,11 @@ public function calculate(BoundingBox $area, $limit_start, $limit_end, // sort by error, best first uasort($errors, 'bccomp'); - $best = array_key_first($errors); + $best = null; + foreach($errors as $k => $v) { + $best = $k; + break; + } $r = $results[$best]; $c = $r->asArray();