Examveda
Examveda

What will be the output of the following PHP code ?
<?php
define("NEW_GOOD_NAME_CONSTANT", "I have a value");
define("OLD_BAD_NAME_CONSTANT", NEW_GOOD_NAME_CONSTANT);
 
echo NEW_GOOD_NAME_CONSTANT;
echo OLD_BAD_NAME_CONSTANT; 
?>

A. I have a value

B. I have a valueI have a value

C. ERROR

D. I have a valueNEW_GOO_NAME_CONSTANTS

Answer: Option B

Solution(By Examveda Team)

Constants can be set as values for other constants.

This Question Belongs to PHP >> Operators And Expressions In Php

Join The Discussion

Related Questions on Operators and Expressions in php