PrepAway - Latest Free Exam Questions & Answers

Which of the following is NOT true about PHP traits?

Which of the following is NOT true about PHP traits? (Choose 2)

PrepAway - Latest Free Exam Questions & Answers

A.
A trait can implement an interface.

B.
A trait can declare a private variable.

C.
Traits are able to be auto-loaded.

D.
Traits automatically resolve conflicts based on definition order.

E.
Multiple traits can be used by a single class.

2 Comments on “Which of the following is NOT true about PHP traits?

  1. Tony says:

    Probably its a old question, or a wrong one. The only option that could match is A. The option D is a true one, because Traints really resolve conflicts based on definition order.

    see http://php.net/manual/en/language.oop5.traits.php
    “The precedence order is that methods from the current class override Trait methods, which in turn override methods from the base class. “




    0



    0

Leave a Reply

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