Ask Your Question
3

Can the reserved keywords (public, private, default) in PHP be used in a namespace?

asked 2023-01-17 11:00:00 +0000

pufferfish gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-11-08 16:00:00 +0000

scrum gravatar image

Yes, reserved keywords like public, private, and default can be used in a PHP namespace. However, they will behave as normal keywords within the namespace and cannot be used as namespace identifiers. For example, you cannot create a namespace named "public" or "private".

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-01-17 11:00:00 +0000

Seen: 9 times

Last updated: Nov 08 '22