-
-
Notifications
You must be signed in to change notification settings - Fork 743
Closed
rectorphp/rector-src
#2859Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | v0.12 |
We're trying to upgrade a project from PHP 7.4 to 8.1 and came across a nested ternary expression which will error out in later PHP versions (8.0+)
Minimal PHP Code Causing Issue
function nested_ternary()
{
$a = 1;
$b = 2
$value = $a ? $b : $a ?: null;
}Expected Behaviour
Since the interpreter used to have some sort of handling it. It might be right to assume the previous working and give some sort of notice to recheck it manually? but also change it according to the previous handling (by adding parathesis RTL):
function nested_ternary()
{
$a = 1;
$b = 2
$value = ($a ? $b : $a) ?: null;
}Reactions are currently unavailable