Skip to content

Invalid Math calculation From PHP 8.0.0 #9331

@hamedmoody

Description

@hamedmoody

Description

Result of the following code correct in all php versions except PHP 8 and up

<?php
$price	= 1390000;
$amount = 55;
var_dump( $price - ( $price * ($amount / 100)) );

Result in PHP version < 8.0.0:

float(625500)

Result in PHP version >= 8.0.0:

float(625499.9999999999)

PHP Version

PHP 8..

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions