Skip to content

Commit

Permalink
fix(PhpEnum):Fix bccomp scale bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yinfuyuan committed Jan 12, 2021
1 parent 081f755 commit 8ed95e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PhpEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public final function propertyEquals($property, $value, $strict = true)
return false;
}
$scale = intval($this->scale());
if ($scale > 0 || !extension_loaded('bcmath')) {
if ($scale <= 0 || !extension_loaded('bcmath')) {
return strval($mixed) === strval($value);
}
return bccomp(strval($mixed), strval($value), $scale) === 0;
Expand Down

0 comments on commit 8ed95e8

Please sign in to comment.