Skip to content

Add (void) casting syntax for PHP 8.5#5546

Open
jordikroon wants to merge 1 commit intophp:masterfrom
jordikroon:docs/void-cast
Open

Add (void) casting syntax for PHP 8.5#5546
jordikroon wants to merge 1 commit intophp:masterfrom
jordikroon:docs/void-cast

Conversation

@jordikroon
Copy link
Copy Markdown
Member

Added the (void) cast to indicate that not using a value is intentional. The (void) cast has no effect on the program's execution by itself, but it can be used to suppress warnings emitted by #[\NoDiscard] and possibly also diagnostics emitted by external IDEs or static analysis tools. RFC: https://wiki.php.net/rfc/marking_return_value_as_important

#5038 depends on this.

@jordikroon jordikroon requested a review from TimWolla May 7, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant