View Issue Details

IDProjectCategoryView StatusLast Update
0002264XdebugUncategorizedpublic2024-04-23 16:52
Reporterconnor Assigned To 
PrioritylowSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version3.2.0 
Summary0002264: Rounding of fractional numbers
Description

The following source code rounds infinite decimal fractions on several php 8 and xdebug versions. It doesn't seem to truncate the decimal part (like converting to int would do), but does a proper rounding. The problem is that in the IDE, when I look at the value of the variable, it also shows the rounded value (see attached image).

With Xdebug:
239749.99999999997
/Users/connor/Work/forms/test.php:9:
double(239750)
double

Without Xdebug:
239749.99999999997
float(239749.99999999997)
double

Steps To Reproduce

<?php

$s = 342_500;
$s *= 0.7;
echo var_export($s);
echo PHP_EOL;
var_dump($s);
echo gettype($s);
echo PHP_EOL;

TagsNo tags attached.
Attached Files
Operating Systemmacos
PHP Version8.2.0-8.2.9

Activities

Issue History

Date Modified Username Field Change
2024-04-23 16:52 connor New Issue
2024-04-23 16:52 connor File Added: Screenshot 2024-04-23 at 18.50.14.png