You're developing a PHP application where you need to segregate classes that handle database operations and email sending. Which feature of PHP allows you to group these classes in a way that they can coexist even if they have the same class name?
- Namespaces
- Traits
- Interfaces
- Abstract Classes
Namespaces in PHP allow you to group classes and avoid naming conflicts, even if they have the same class name. This is essential for organizing code and preventing naming collisions.
Loading...
Related Quiz
- In a PHP do...while loop, the condition is tested ______ the code block is executed.
- What does $GLOBALS mean?
- You have a long string containing multiple words and you need to extract each word as an individual item in an array. Which PHP function would be most suitable for this task?
- The rand() function in PHP returns a ______ integer.
- To move an uploaded file to a new location, PHP provides the ________ function.