Skip to content

Fix GH-16665: \array and \callable should not be usable#16683

Closed
ndossche wants to merge 1 commit intophp:masterfrom
ndossche:fix-16665
Closed

Fix GH-16665: \array and \callable should not be usable#16683
ndossche wants to merge 1 commit intophp:masterfrom
ndossche:fix-16665

Conversation

@ndossche
Copy link
Copy Markdown
Member

@ndossche ndossche commented Nov 2, 2024

This list was initially introduced in 53a4038, but never included array or callable. I suppose this is because int & friends are not actual tokens, while array and callable are. This means it was never possible to do class array, which is probably the reason this was overlooked.

This list was initially introduced in 53a4038, but never included array or
callable. I suppose this is because int & friends are not actual tokens,
while array and callable are. This means it was never possible to do class
array, which is probably the reason this was overlooked.
@ndossche ndossche linked an issue Nov 2, 2024 that may be closed by this pull request
@jorgsowa
Copy link
Copy Markdown
Contributor

jorgsowa commented Nov 2, 2024

What about other keywords like readonly, private, etc.? It's also not possible to create such classes.

@ndossche
Copy link
Copy Markdown
Member Author

ndossche commented Nov 3, 2024

But those don't indicate types while array and callable do.

Comment on lines +217 to +218
/* These are not usable as class names because they're proper tokens,
* but they are here for class aliases. */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What about list, while, ..?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

See my comment #16683 (comment)

@ndossche ndossche requested review from dstogov and iluuu1994 November 5, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

\array should not be usable

5 participants