Zend Certified PHP Engineer (ZCPE) Practice Test

Get more with Examzify Plus

Remove ads, unlock favorites, save progress, and access premium tools across devices.

FavoritesSave progressAd-free
From $9.99Learn more

1 / 400

What keyword is used to extend a class in PHP?

Implements

Extends

In PHP, the keyword used to extend a class is "extends." This keyword is fundamental to the object-oriented programming paradigm in PHP as it allows one class to inherit the properties and methods of another class, enabling code reuse and a hierarchical class structure. When a class is defined to extend another class, it gains access to all non-private methods and properties of the parent class.

Using "extends" allows you to create a new class that builds upon the existing functionality of a parent class, providing a way to customize and enhance behavior while still retaining the original features. This is essential for implementations of polymorphism and encapsulation, key concepts within object-oriented programming.

The other options do not serve the purpose of class inheritance. "Implements" is used when a class is implementing an interface, while "inherits" is not a recognized keyword in PHP. "Includes" pertains to file inclusion and does not relate to class relationships. Understanding the distinction between these keywords is crucial for mastering object-oriented programming in PHP.

Get further explanation with Examzify DeepDiveBeta

Inherits

Includes

Next Question
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy