Php

PHP Front To Back [Part 20] – OOP



In this video I will introduce object oriented programming in PHP using classes, properties and methods

CODE: Code for this video

EDUONIX COURSES: Please use affiliate links from website below

SUPPORT: We spend massive amounts of time creating these free videos, please donate to show your support:

FOLLOW…

Similar Posts

46 thoughts on “PHP Front To Back [Part 20] – OOP
  1. Nice to see you man!! Just a moment ago, after spending, hmm I dont know how many hours it took me watching this entire series from start, so just a moment ago that question randomly came to my mind, which is : how does brad look like??… and Next video, holly shit!!! this is brad!!! lol

  2. OOP after JavaScript just takes a while, like a brain reset I guess. I have read and done hours and many chapters/ videos of java tutorials …for some reason after watching this video it finally actually sticks lol.

  3. Awesome tutorial! But I have a question: in the Customer class, the constructor uses the parent constructor by passing to it three parameters. However, this constructor of the Person takes only two. Why doesn't php complain about that? And what it does with that third parameter?

  4. OOP lost me a lot when I went through it on JS and it makes very lost here too. I don't know why but when I have to actually do something with it I get lost as hell and struggle a ton. It seems quite convoluted to me . I 'm sure with practice I'll end up grasping it but it's been the hardest thing so far for me.

  5. Thanks for the great video! One of the BEST explanations of Classes and Inheritance I have ever seen.

    A few comments:
    1. The video of you in the corner is a little distracting, and really doesn't add any value other than ownership.
    2. Instead of the word "arrow" for the object operator, may I suggest "dart". Smoother, cleaner, and never confused with the greater than sign.
    3. You should NEVER put markup directly in your Object Methods. You can never anticipate what else the property might be used for.
    4. It's always a good idea to wrap your concatenation operators with a single space. It reads cleaner, and is less likely to be overlooked.

    Note: For anyone watching this after 2019 using PHP 7.4+, "Getters and Setters" have been replaced by Typed Properties.

    Thanks again and keep up the great work!

  6. Why no one points the mistake about the constructor of the child class. I think it should be like this:
    public function __construct($name, $email, $balance){

    parent::__construct($name, $email);

    $this->balance = $balance;

    echo 'a new '.__CLASS__.' has been created<br>';

    }
    the parent constructor has only two parameters, not three.

  7. You have an error in your code: you need only to pass two arguments name and email to the parent constructor (person) and not three. The balance argument or property belongs to the customer constructor where it should be initialized, and it should not be passed to the parent constructor person. I am surprised that php did not flag this as an error as java does. BTW what is the facetime app that you are using besides recording with camtasia

  8. I actually hate facetime tutorials I find it is so distracting to my learning experience.
    This the reason I avoided Maximilian Schwarzmüller  courses and got yours instead.

  9. f'kng awesome! Great job man! easy to understand explanations in plain English. Love all the videos and binged on them.. just now got around to comment. Thank you for this fantastic work.

  10. The constructor of customer needs to be fixed. Not sure how this is possible in php, but you are not using a proper signature for the Person constructor in the Customer constructor @CMos

  11. Hello, I got problem with constructors. here is my output.
    *
    A new Customer has been created
    300
    Person destroyed
    Person created
    *
    Everything is clear with logic thats just stupid that
    for some reason constructor is ran after destructor. I copied your code and it seems problem is not in code. Im on ubuntu 1804 with xampp

  12. This was yet another very Challenging Tutorial. I wrote my first bit of Object Oriented Programming with this, and understood it for the first time. I think I'm going to do your Crash Course on PHP OOP before moving on to the next lesson. Fantastic job! It all made sense in the end. I'm amazed at how you manage to fit all the stuff in. I've also been taking copious notes of the things you point out during the instruction. Thanks a bunch!

Leave a Reply

Your email address will not be published. Required fields are marked *