Assuming the Horse class exists, which is a valid example of inheritance in PHP?

  1. class Pegasus extends Horse {}
  2. class Alicorn imports Pegasus, Unicorn {}
  3. class Unicorn implements Horse {}
  4. class Horse inherits Unicorn {}

Correct Answer:

  • class Pegasus extends Horse {}

Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *