Loading video...
Introduction to Object-Oriented Programming
- Object-oriented programming, or OOP, is a programming paradigm that allows user-defined data types to be created that model ‘real-world’ objects. Object-oriented programs work with and manipulate these 'objects'.
- A class provides a formal description of how a particular real-world object is to be modeled in code. It is a ‘template’ for a user-defined data type.
- A class can describe both the properties a particular type of object has, as well as any functions, known as methods, that a particular type of object can perform.
- Classes are defined in PHP using the
classkeyword. Class names follow the same rules as variable names and by convention always have their first letter capitalized. Classes definitions also typically follow the one-class-per-file convention and have their definition file have the same name as the class. - An object refers to a particular instance of a class data type declared in PHP code.
- Creating an object is known as instantiating, or creating an instance, of a class.
- The
newkeyword is used to create an object, or an instance of, a class in PHP. - For objects of a particular class to be instantiated in a PHP script, the class definition file for those objects must be included or defined somewhere within the script.
- An object’s properties can be set or accessed using the
->syntax.
Introduction to Object-Oriented Programming
Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

































Start Learning Now
Our free lessons will get you started (Flash® 10 required).
Sign up for Educator.comGet immediate access to our entire library.
Features Overview