Skip to content

[PHP] add missing reserved words: mixed, never and object #22317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fernandocarletti
Copy link

A few reserved keywords are missing in the protobuf implementation:

  • mixed (PHP 8.0)
  • never (PHP 8.1)
  • object (PHP 7.2)

They are described in this page: https://www.php.net/manual/en/reserved.other-reserved-words.php.

There should be no breaking changes to the current active versions considering that PHP 7.2 and 8.0 already reached EOL and PHP 8.1 is under security fixes only according to its website: https://www.php.net/supported-versions.php. Any attempt to use those words generates a fatal error in PHP 8.1+.

@fernandocarletti fernandocarletti requested a review from a team as a code owner June 20, 2025 04:59
@fernandocarletti fernandocarletti requested review from bshaffer and removed request for a team June 20, 2025 04:59
"require"=>0, "require_once"=>0, "return"=>0, "self"=>0, "static"=>0,
"string"=>0, "switch"=>0, "throw"=>0, "trait"=>0, "true"=>0,
"try"=>0, "unset"=>0, "use"=>0, "var"=>0, "void"=>0,
"while"=>0, "xor"=>0, "yield"=>0,
Copy link
Author

Choose a reason for hiding this comment

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

For whoever is reviewing it, I noticed that some keys were not alphabetically ordered, being more difficult to find the keywords when checking for it.

Since I was already changing it, I ended up refactoring it to reorder them, hence the bigger change set. Let me know if this is a problem, I can revert it and add the keys to the end only.

The same was done in names.cc.

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