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.
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 php.net to see which versions of PHP are supported. Also, verify your version of PHP on your localhost as well as your web host.