PHP 8.3+ fatal errors
-
Hi there,
I found two problems in your plugin on Cloudways (DigitalOcean) hosting on PHP 8.3 + nginx.
Both issues are in the same file: /src/PriceManager.php
#1 – line 83 – original code:
$productPrice = round( $productPrice, $roundPrecision );revised code:
$productPrice = $productPrice && is_numeric( $productPrice ) ? round( $productPrice, $roundPrecision ) : $productPrice;Problem is that the value of the
$productPricevariable is string instead of int.#2 – line 194 – original code:
return 100 * ($originalPrice - $currentPrice) / $originalPrice;revised code:
return 100 * (floatval($originalPrice) - floatval($currentPrice)) / $originalPrice;same problem:
$originalPriceand$currentPriceare string.Best regards,
Adrian
The topic ‘PHP 8.3+ fatal errors’ is closed to new replies.