Which code snippet uses the correct syntax for creating an instance of the Pet class?

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
  • $dog = new Pet;
  • all of these answers
  • $horse = (new Pet);
  • $cat = new Pet();
0/5 (0 Reviews)

Like this article?

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest

Related Posts