[php-src] Issue #7741: Literal value of PHP_INT_MIN is converted to float
| From: | noreply@php.net | Date: | Wed, 08 Dec 2021 22:42:22 +0000 |
| Subject: | [php-src] Issue #7741: Literal value of PHP_INT_MIN is converted to float | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-238293@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/7741
Author: ragol
### Description
The following code:
```php
<?php
var_dump(-9223372036854775807);
var_dump(-9223372036854775808);
var_dump(PHP_INT_MIN);
var_dump(-9223372036854775807 - 1 === PHP_INT_MIN);
var_dump(-9223372036854775808 === PHP_INT_MIN);
```
Resulted in this output in PHP 8 (all versions:
```
int(-9223372036854775807)
float(-9.223372036854776E+18)
int(-9223372036854775808)
bool(true)
bool(false)
```
Resulted in this output in PHP 7 (all versions):
```
int(-9223372036854775807)
float(-9.2233720368548E+18)
int(-9223372036854775808)
bool(true)
bool(false)
```
But I expected this output instead:
```
int(-9223372036854775807)
int(-9223372036854775808)
int(-9223372036854775808)
bool(true)
bool(true)
```
### PHP Version
all versions of PHP 7 and 8
### Operating System
_No response_