1.

What will happen if you try to set a value to a constant once it has been declared?(a) The value of the variable will change(b) The value of the variable will not change(c) Parse Error(d) NothingI got this question during an online exam.The origin of the question is Object Advanced Features in chapter Objects and Databases in PHP of PHP

Answer»

Right OPTION is (c) PARSE Error

For explanation: You should use constants when your property NEEDS to be available across all instances of a CLASS, and when the property VALUE needs to be fixed and unchanging.



Discussion

No Comment Found

Related InterviewSolutions