Examveda
Examveda

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. Nothing

Answer: Option C

Solution(By Examveda Team)

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.

This Question Belongs to PHP >> Object Oriented Concept

Join The Discussion

Related Questions on Object Oriented Concept