<?php
$precoBase = (float)71612.54;
$sumLotes= array_sum(array((float)4568.20,(float)26370.24,(float)13986.00,(float)1745.60,(float)18295.00,(float)6647.50));
if ($precoBase === $sumLotes) { // Comparing value and data type.
echo 'OK';
}else{
echo 'LOLPHP - NOK' . PHP_EOL;
var_dump($precoBase,$sumLotes);
}
- Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.26, 8.3.0 - 8.3.14, 8.4.1
- LOLPHP - NOK
float(71612.54)
float(71612.54000000001)
- Output for 4.3.10 - 4.3.11, 4.4.0 - 4.4.9, 5.0.2 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.21, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
- LOLPHP - NOK
float(71612.54)
float(71612.54)
- Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
- Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/jm7pj on line 9
LOLPHP - NOKPHP_EOLfloat(71612.54)
float(71612.54)
preferences:
88.11 ms | 408 KiB | 5 Q