Major bug in XAMPP PHP 8.0.6
Posted: 25. May 2021 17:29
Environment: xampp-linux-x64-8.0.6-0-installer.run on Fedora 34 x64
Run this on xampp php 8.0.6, you will get different output. Any idea why this is happening??
Wrong Output from XAMPP PHP
Correct output from PHP 8.0.6 (from fedora remi repo or debian deb sury repo)
Run this on xampp php 8.0.6, you will get different output. Any idea why this is happening??
- Code: Select all
<?php
var_dump(round(3.4));
var_dump(round(3.5));
var_dump(round(3.6));
var_dump(round(3.6, 0));
var_dump(round(5.045, 2));
var_dump(round(5.055, 2));
var_dump(round(345, -2));
var_dump(round(345, -3));
var_dump(round(678, -2));
var_dump(round(678, -3));
Wrong Output from XAMPP PHP
- Code: Select all
float(3)
float(4)
float(4)
float(4)
float(5.04999999999999982236431605997495353221893310546875)
float(5.05999999999999960920149533194489777088165283203125)
float(300)
float(0)
float(700)
float(1000)
Correct output from PHP 8.0.6 (from fedora remi repo or debian deb sury repo)
- Code: Select all
float(3)
float(4)
float(4)
float(4)
float(5.05)
float(5.06)
float(300)
float(0)
float(700)
float(1000)