Object Oriented Programming (Course 1)
Understand the difference between classes & objects, learn about visibility & type-hinting in our OOP tutorial, it's a blast!
About this course
Get Object-Oriented!
In this course, we'll get you up and running with classes, objects, methods, properties and all that OO stuff by building a real (and epic) application where we battle space ships. Woh.
Expect to get really comfortable with object-oriented fundamentals, including:
- Creating a class
- Instantiating objects (many objects!)
- Classes verus objects (what's the diff?)
- Class methods
- Visibility (that public, private, protected stuff)
- Type-hinting
- Class constructors (the
__construct
guy)
Then keep going with course 2.
Blast off! #NerdPun
Next courses in the Drupal 8: The OO Prerequisites section of the Drupal 8 Track!
7 Comments
So nice of you to say! REALLY happy you found it useful - we wanted an OO guide for the real world!
Cheers!
I feel like this needs a few updates with some cool new php8.1 updates, more types, enums and a class looking more like https://stitcher.io/blog/evolution-of-a-php-object every now and then...
It's my favorite tutorial to share when someone needs to learn OOP, but sadly I've gotten to the point where I constantly need to say 'but this can be done in a better way nowadays'
Hey Gabs!
Thanks for the note! I actually agree. While OO doesn't fundamentally change much, enough features have accumulated in PHP over the years that these OO tutorials could probably use a facelift. It's something we're going to look into updating for 2023. And thanks for sharing the tutorial with others - that's very awesome of you :).
Cheers!
I have watched 2 oo episodes and learned A LOT of things that I couldn't find anywhere else, this is awesome. Man, you HAVE TO check this out