Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: What is the purpose of the 'namespace' keyword in PHP?
Answer: Namespaces are used to avoid naming conflicts between classes, functions, and constants. They provide a way to organize code into logical and hierarchical structures.

Example:

namespace MyNamespace; 
class MyClass { /* class definition */ }
Is it helpful? Yes No

Most helpful rated by users:

©2026 WithoutBook