Multi Class Inheritance

Ultimate PHP and MySQL Web Development Object Oriented Programming
2 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€84.92
List Price:  €118.90
You save:  €33.97
£74.06
List Price:  £103.69
You save:  £29.62
CA$136.81
List Price:  CA$191.54
You save:  CA$54.73
A$148.86
List Price:  A$208.41
You save:  A$59.55
S$128.39
List Price:  S$179.76
You save:  S$51.36
HK$777.09
List Price:  HK$1,087.96
You save:  HK$310.87
CHF 78.91
List Price:  CHF 110.47
You save:  CHF 31.56
NOK kr1,000.83
List Price:  NOK kr1,401.21
You save:  NOK kr400.37
DKK kr634.47
List Price:  DKK kr888.29
You save:  DKK kr253.81
NZ$171.30
List Price:  NZ$239.83
You save:  NZ$68.52
د.إ367.21
List Price:  د.إ514.11
You save:  د.إ146.90
৳12,220.44
List Price:  ৳17,109.11
You save:  ৳4,888.66
₹8,977.71
List Price:  ₹12,569.16
You save:  ₹3,591.44
RM404.80
List Price:  RM566.74
You save:  RM161.94
₦145,094.48
List Price:  ₦203,138.08
You save:  ₦58,043.60
₨28,013.30
List Price:  ₨39,219.75
You save:  ₨11,206.44
฿3,107.58
List Price:  ฿4,350.74
You save:  ฿1,243.15
₺4,283.32
List Price:  ₺5,996.82
You save:  ₺1,713.49
B$554.37
List Price:  B$776.14
You save:  B$221.77
R1,666.63
List Price:  R2,333.35
You save:  R666.72
Лв166.02
List Price:  Лв232.43
You save:  Лв66.41
₩144,218.57
List Price:  ₩201,911.77
You save:  ₩57,693.20
₪319.22
List Price:  ₪446.92
You save:  ₪127.70
₱5,870.26
List Price:  ₱8,218.60
You save:  ₱2,348.33
¥15,655.93
List Price:  ¥21,918.93
You save:  ¥6,263
MX$1,790.90
List Price:  MX$2,507.33
You save:  MX$716.43
QR364.51
List Price:  QR510.32
You save:  QR145.81
P1,314.55
List Price:  P1,840.43
You save:  P525.87
KSh12,893.71
List Price:  KSh18,051.71
You save:  KSh5,158
E£4,754.90
List Price:  E£6,657.05
You save:  E£1,902.15
ብር15,558.93
List Price:  ብር21,783.13
You save:  ብር6,224.19
Kz91,219.48
List Price:  Kz127,710.93
You save:  Kz36,491.44
CLP$90,580.94
List Price:  CLP$126,816.94
You save:  CLP$36,236
CN¥700.59
List Price:  CN¥980.86
You save:  CN¥280.26
RD$6,268.37
List Price:  RD$8,775.97
You save:  RD$2,507.60
DA12,969.49
List Price:  DA18,157.81
You save:  DA5,188.31
FJ$226.89
List Price:  FJ$317.66
You save:  FJ$90.76
Q766.16
List Price:  Q1,072.65
You save:  Q306.49
GY$20,921.62
List Price:  GY$29,291.11
You save:  GY$8,369.48
ISK kr12,571.74
List Price:  ISK kr17,600.94
You save:  ISK kr5,029.20
DH912.39
List Price:  DH1,277.39
You save:  DH364.99
L1,677.58
List Price:  L2,348.67
You save:  L671.09
ден5,227.78
List Price:  ден7,319.11
You save:  ден2,091.32
MOP$801.02
List Price:  MOP$1,121.47
You save:  MOP$320.44
N$1,664.35
List Price:  N$2,330.15
You save:  N$665.80
C$3,680.29
List Price:  C$5,152.56
You save:  C$1,472.26
रु14,368.75
List Price:  रु20,116.83
You save:  रु5,748.07
S/336.50
List Price:  S/471.12
You save:  S/134.61
K431.86
List Price:  K604.62
You save:  K172.76
SAR375.20
List Price:  SAR525.30
You save:  SAR150.09
ZK2,257.52
List Price:  ZK3,160.62
You save:  ZK903.09
L432.46
List Price:  L605.47
You save:  L173
Kč2,058.75
List Price:  Kč2,882.33
You save:  Kč823.58
Ft32,856.71
List Price:  Ft46,000.71
You save:  Ft13,144
SEK kr915.69
List Price:  SEK kr1,282.01
You save:  SEK kr366.31
ARS$145,090.96
List Price:  ARS$203,133.16
You save:  ARS$58,042.19
Bs692.55
List Price:  Bs969.60
You save:  Bs277.04
COP$376,785.69
List Price:  COP$527,515.04
You save:  COP$150,729.35
₡49,946.85
List Price:  ₡69,927.60
You save:  ₡19,980.74
L2,635.99
List Price:  L3,690.49
You save:  L1,054.50
₲677,713.63
List Price:  ₲948,826.20
You save:  ₲271,112.56
$U3,919.50
List Price:  $U5,487.46
You save:  $U1,567.95
zł357.96
List Price:  zł501.17
You save:  zł143.20
Already have an account? Log In

Transcript

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.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.