1.

Which one of the following is a constant variable?(a) const $name(b) const $NAME(c) constant NAME(d) const NAMEThe question was posed to me in unit test.Origin of the question is Object Advanced Features in section Objects and Databases in PHP of PHP

Answer»

The correct CHOICE is (d) const NAME

For explanation I WOULD say: Constants are not prefixed with a dollar sign like regular properties. By convention, they are OFTEN NAMED using only UPPERCASE characters



Discussion

No Comment Found

Related InterviewSolutions