Skip to content

Fix setcookie() documentation for invalid options in PHP 8.0+#5104

Merged
Girgias merged 6 commits intophp:masterfrom
lacatoire:doc/setcookie-invalid-options-valueerror
Jan 30, 2026
Merged

Fix setcookie() documentation for invalid options in PHP 8.0+#5104
Girgias merged 6 commits intophp:masterfrom
lacatoire:doc/setcookie-invalid-options-valueerror

Conversation

@lacatoire
Copy link
Contributor

The setcookie() documentation states that passing an invalid key in the options array triggers an E_WARNING.

Since PHP 8.0, invalid option keys throw a ValueError instead. This PR updates the documentation to accurately reflect the current behavior while preserving the pre-8.0 behavior for reference.

Issue: #4985

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on the doc! Please amend following the comments. :)

@lacatoire lacatoire requested a review from Girgias January 15, 2026 09:45
@lacatoire
Copy link
Contributor Author

Thanks for the review @Girgias
I’ve updated the PR accordingly: the error behavior has been moved to a dedicated errors section, the corresponding changelog entry was added, and the sections have been reordered to match the required structure.

Co-authored-by: Gina Peter Banyard <girgias@php.net>
@Girgias Girgias merged commit b41e78e into php:master Jan 30, 2026
2 checks passed
@lacatoire lacatoire deleted the doc/setcookie-invalid-options-valueerror branch January 30, 2026 10:08
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.

2 participants