Skip to content

[DeadCode] Skip multi-arg isset with side effects in RemoveDeadStmtRector - #9026

Closed
TomasVotruba wants to merge 2 commits into
mainfrom
fix-dead-stmt-isset-short-circuit
Closed

TomasVotruba wants to merge 2 commits into
mainfrom
fix-dead-stmt-isset-short-circuit

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

isset() with several args stops on the first unset one, so calls inside later args run only conditionally. The rule extracted all of them as unconditional statements:

isset($b[func1()], $c[func2()]);

became

func1();
func2(); // ran even when $b[func1()] is not set

Now a multi-arg isset() statement with side effects after the first arg is skipped. Single-arg isset() keeps the current behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant