PHP OOP Introduction
Larry Ullman is a writer, Web and software developer, trainer, instructor, speaker, and consultant. He has written 22 books and numerous articles. His books have sold over , copies worldwide in more than 20 languages. As his readers, students, and co-workers can attest, Larry's strength is in translating geek into English: converting the technical and arcane into something comprehensible and useful. Toggle navigation.
Introducing new learning courses and educational videos from Apress. Start watching. However, how do you go about creating a copy of an object if all objects are treated as references? By cloning the object. Inheritance : As discussed in Chapter 6, the ability to build class hierarchies through inheritance is a key concept of OOP. Interfaces : An interface is a collection of unimplemented method definitions and constants that serves as a class blueprint. Interfaces define exactly what can be done with the class, without getting bogged down in implementation-specific details.
It is considered to be more powerful and fast for certain tasks than the normal way of programming in PHP. OOP helps you to create and manage tasks easily. OOP is harder to understand compared to other programming techniques. But, if you understand the following 4 terms you are almost done! The first term we find in OOP is class.
Object Oriented Programming Principles
We can imagine our universe made of different objects like sun, earth, moon etc. Similarly we can imagine our car made of different objects like wheel, steering, gear etc. Same way there is object oriented programming concepts which assume everything as an object and implement a software using different objects. You can think of a class as a template for making many instances of the same kind or class of object. You define a class once and then make many objects that belong to it. Objects are also known as instance.