Just to let you know the method he made 'function drivecar(CarInterface $cars)' this parameter is known as Type Hinting Type Hinting is a way to tell a method that the object which is going to be passed must be from a specific class. Which in this case is CarInterface. '$cars' is just a reference to let the method know that an object is going to be passed, you can use any other name like '$c' or '$a' but the class should have the same name as shown in this example.
Thax bhai awesome video ❤❤
amazng man,,,,got the real use of of opps from this chanles,,,
Very good explanation, keep continue doing such more useful php oop videos, thanks!
Well explained, it cleared my concept of interfaces.
line number 26(is it dependency injection)?
Just to let you know the method he made 'function drivecar(CarInterface $cars)' this parameter is known as Type Hinting
Type Hinting is a way to tell a method that the object which is going to be passed must be from a specific class. Which in this case is CarInterface. '$cars' is just a reference to let the method know that an object is going to be passed, you can use any other name like '$c' or '$a' but the class should have the same name as shown in this example.
awesome. thanks for the explanation.
@@ajay-yadav sir is any difference we face if we only pass car as object in parameter in function yes then how