You are working on a project where certain methods in your classes should only be defined but not implemented, and the actual implementation should be provided by the derived classes. Which PHP concept helps achieve this?
- Interface
- Trait
- Abstract Class
- Final Class
An interface defines method signatures without implementations. Derived classes that implement the interface must provide the implementation for those methods. This is a common approach in PHP to achieve this requirement.
Loading...
Related Quiz
- In PHP, constant identifiers are always case-______.
- The control structure that allows for multiple conditions to be checked in a single statement is called ________.
- You've been tasked with improving the security of an existing web application. Upon review, you notice that the application doesn't validate or sanitize user input before processing. Which potential vulnerabilities could this introduce?
- Which of the following is used in PHP to declare a floating-point number?
- In PHP, a string can contain letters, numbers, and special characters.