- [Instructor] In this movie…we'll learn how to use our class definition…to create an instance.…Let's begin with the definition…for this word instance.…In general use, an instance is a single occurrence…of something.…When we're talking about object oriented programming,…that single occurrence of something…is a single object…created from a class definition.…So we're be using this word instance a lot.…And you'll hear the terms object…and instance used interchangeably.…I'm certain that I'm going to do it,…but instance is technically…the more correct term.…
So let's see how we create an instance.…The first thing, of course, is we have to have…a class definition before we can create…an instance of it.…The way we create the instance of the class…is by using the new keyword…followed by the class name.…This is called instantiation.…Or we could use it as a verb…and say that we instantiate it.…Instantiation is just a fancy word…that means to create an instance.…Note that the class name here is not a string.…Once a class has been declared,…
Author
Released
11/17/2017- Defining classes
- Calling methods
- Class inheritance
- Extending and overriding classes
- Accessing and controlling access to properties and methods
- Static properties and methods
- Magic methods: constructor, destructor, and clone
- Creating a PHP OOP project
Skill Level Intermediate
Duration
Views
Related Courses
-
PHP: Accessing Databases with PDO and MySQLi
with David Powers3h 47m Intermediate -
Consuming RESTful APIs in PHP with Guzzle
with Justin Yost2h 12m Intermediate
-
Introduction
-
Welcome1m 3s
-
-
1. Overview and Project Setup
-
What is OOP?5m 21s
-
Project setup3m 1s
-
-
2. Object Basics
-
Define a class5m 52s
-
Instances6m 13s
-
Class properties9m 56s
-
Class methods5m 12s
-
Refer to an instance3m 54s
-
-
3. Class Inheritance
-
What is inheritance?3m 26s
-
Define a subclass7m 27s
-
Extend and override7m 7s
-
Challenge: Inheritance3m 11s
-
Solution: Inheritance8m 10s
-
-
4. Object Access Control
-
Visibility modifiers9m 18s
-
Beware of overloading5m 37s
-
Setter and getter methods4m 46s
-
Challenge: Access control2m 51s
-
Solution: Access control8m 33s
-
-
5. Static Properties and Methods
-
The static modifier7m 12s
-
Inherited static behaviors5m 45s
-
Class constants4m 43s
-
Refer to the parent class7m 19s
-
Late static bindings7m 12s
-
Challenge: Static references3m 30s
-
Solution: Static references7m 45s
-
-
6. Magic Methods
-
Constructor method4m 46s
-
Constructor arguments7m 51s
-
Destructor method4m 34s
-
Clone method6m 9s
-
Assignment by reference4m 20s
-
Compare objects4m 8s
-
-
7. A PHP OOP Project
-
Project introduction5m 57s
-
Challenge: The bicycle class2m 53s
-
Solution: The bicycle class6m 36s
-
From instances to HTML6m 46s
-
Read from a CSV file7m 44s
-
Improve parseCSV5m 43s
-
From a CSV file to instances2m 33s
-
-
Conclusion
-
Next steps36s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Instances