Skip to Content
PHP 7: Real World Application Development
book

PHP 7: Real World Application Development

by Doug Bierer, Altaf Hussain, Branko Ajzele
September 2016
Intermediate to advanced
1091 pages
21h 41m
English
Packt Publishing
Content preview from PHP 7: Real World Application Development

Chapter 4. Working with PHP Object-Oriented Programming

In this chapter we will cover:

  • Developing classes
  • Extending classes
  • Using static properties and methods
  • Using namespaces
  • Defining visibility
  • Using interfaces
  • Using traits
  • Implementing anonymous classes

Introduction

In this chapter, we will consider recipes that take advantage of the object-oriented programming (OOP) capabilities available in PHP 7.0, 7.1, and above. Most of the OOP functionality available in PHP 7.x is also available in PHP 5.6. A new feature introduced in PHP 7 is support for anonymous classes. In PHP 7.1, you can modify the visibility of class constants.

Note

Another radically new feature is the ability to catch certain types of error. This is discussed in greater detail in Chapter ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pro PHP Programming

Pro PHP Programming

Peter MacIntyre, Brian Danchilla, Mladen Gogala
Learning PHP 7

Learning PHP 7

Antonio L Zapata (GBP)
Intermediate PHP

Intermediate PHP

Lorna Jane Mitchell
Mastering PHP 7

Mastering PHP 7

Branko Ajzele

Publisher Resources

ISBN: 9781787129009