PHP - Inheritance and Polymorphism
Identify the problem in this PHP code snippet:
class User {}
class Admin extends User {}
function login(Admin $a) {
echo "Admin logged in";
}
$user = new User();
login($user);Identify the problem in this PHP code snippet:
class User {}
class Admin extends User {}
function login(Admin $a) {
echo "Admin logged in";
}
$user = new User();
login($user);15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions