1.

Which version of PHP introduced the visibility keywords i.e public, private, and protected?(a) PHP 4(b) PHP 5(c) PHP 5.1(d) PHP 5.3This question was addressed to me in an online interview.My question is from Object Basics-1 topic in portion Objects and Databases in PHP of PHP

Answer»

Correct choice is (b) PHP 5

The EXPLANATION is: In PHP 4, all properties were declared with VAR keyword, which is identical in effect to using public. For the SAKE of backward COMPATIBILITY, PHP 5 accepts var in place of public for properties.



Discussion

No Comment Found

Related InterviewSolutions