PHP - Inheritance and Polymorphism
Which of the following PHP function declarations correctly type hints a parameter to accept an object of the parent class Vehicle?
Which of the following PHP function declarations correctly type hints a parameter to accept an object of the parent class Vehicle?
Vehicle $v. function start($v: Vehicle) {} uses invalid syntax. function start(Vehicle v) {} misses the $ sign. function start(&Vehicle $v) {} uses a reference which is allowed but not related to type hinting correctness.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions