Last updated December 13, 2021

Object-oriented PHP utilizes classes and objects to organize code into reusable chunks. This approach helps us organize complex applications, such as Drupal, into modular code called classes that can be reused across the entire system. As a module developer, knowledge of object-oriented PHP is essential in order to understand the architecture of a module and the various forms it can take as well as how to implement custom functionality.

Example tasks


Learning modern object-oriented PHP practices is a skill that will benefit you not only as a Drupal 8 developer but also as a PHP developer. If you have a doubt about a certain feature working on your project, check to see which versions of PHP are supported. Also, verify your version of PHP on your localhost as well as your web host.

Drupalize.Me resources

As a developer, one of the first new concepts you're going to need to understand for Drupal 8 is PSR-4. Or, the PHP Framework Interoperability Groups (php-fig), Proposal for Standard Request number 4 (PSR-4). A lot of fancy naming, abbreviations and numbers for a pretty simple idea. Allow your PHP classes to be automatically discovered and loaded by following a convention for class namespace and file/directory naming.

More Guides

We have guides on many Drupal skills and topics.

Explore guides

External resources