Bug Report
| Subject |
Details |
| Rector version |
2.5.7 |
The RemoveDeadZeroAndOneOperationRector removes a + 0 operation assuming it has no functionality. That isn't fully true though, it converts a negative zero to a positive zero.
Minimal PHP Code Causing Issue
$value = round(-0.001, 2);
var_dump((string) $value); // output: "-0"
$value = $value + 0;
var_dump((string) $value); // output: "0"
Expected Behaviour
Not sure if it is possible to check the previous value could be a negative zero.
Bug Report
The
RemoveDeadZeroAndOneOperationRectorremoves a+ 0operation assuming it has no functionality. That isn't fully true though, it converts a negative zero to a positive zero.Minimal PHP Code Causing Issue
Expected Behaviour
Not sure if it is possible to check the previous value could be a negative zero.