Skip to content

Commit

Permalink
Fix compatibility with PHP 7.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
goat1000 committed Apr 25, 2023
1 parent 2e31cea commit 99576c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion BestFitCurve.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 99576c9

Please sign in to comment.