How does an object reference itself? By using the $this keyword. "This" keyword can access properties and methods inside the class. We're modifying the car and dog classes to contain use of "this" keyword. If you're having issues with understanding what "this" means in object oriented programming, it's exactly the same as when you reference yourself with the "I" pronoun. The object references itself instead with $this.
Read the full article on my website
https://www.dinocajic.com/php-this-ke...
Code for this tutorial
https://github.com/dinocajic/php-7-yo...
Full Code
https://github.com/dinocajic/php-7-yo...
PHP Playlist
• PHP Tutorial
--
Dino Cajic
Author and Head of IT
Homepage: https://www.dinocajic.com
GitHub: https://github.com/dinocajic
Medium: / dinocajic
Instagram: / think.dino
LinkedIn: / dinocajic
Twitter: / dino_cajic
My Books
An Illustrative Introduction to Algorithms
https://www.amazon.com/dp/1686863268
Laravel Excel: Using Laravel to Import Data
https://amzn.to/4925ylw
Code Along With Me - PHP: From Basic to Advanced PHP Techniques
https://amzn.to/3M6tlGN