Hello, in this video I am going to talk to you about multi class inheritance. So in some programming languages, what you can do is essentially like have this child class that inherits or you know, extend multiple classes. So in another language, it might be something like vehicle and then other know, whatever the other class name is, you can actually do them PHP. But there's sort of a way to get around that if that's, you know, the route you want to go down. Sometimes it's good, sometimes it's bad. I'm just here to show you, you know how to sort of do multi class inheritance.
What you can, however, do is create another class, let's say I call it BMW, this extends call. weapon. And now, instead of this, let's call it BMW OBJ, chorus, II, and W save that Say this car is starting and I am dead. So what this has done, it's inherited all the functionality from car, which has inherited all the functionality from the vehicle as well. And to showcase that you have new dollar, BMW, ob j and call the print on info, print all info There we go. The parental info did not print are okay, so the variables will not all go all the way down.
So if we want the variables we'll need to read declare them here or declare them over here so the functions will get inherited. So again, it's not a you know the Best ultimate solution, but you know, obviously we can access? No, certainly no some of the functionality of it. So we could do like open door. There we go open door. So he will, some of the functionality will go down.
And if there isn't a constructor or destructor, you'll get it from the parent class. So it gets the constructor from here as a non destructor it looks to the parent class of that class, which is vehicle which has a destructor you know, explicitly stated, so it uses that one. So this is how you, you know, sort of handle multi class inheritance in you know, PHP, it's not quite the same as other, you know, programming languages, but I wanted to show you anyway, if you have any questions, feel free to pop me a message. And as usual, I look forward to seeing you in the next video.