What will be the output of the following PHP code ?
  1. <?php
  2. define("GREETING", "PHP is a scripting language", true);
  3. echo GREETING;
  4. echo "<br>"
  5. echo GREETING;
  6. ?>

PHP is a scripting language
GREETING GREEtING
GREETING

PHP is a scripting language

PHP is a scripting language

What will be the output of the following PHP code ?
  1. <?php
  2. define("GREETING", "PHP is a scripting language");
  3. echo $GREETING;
  4. ?>

$GREETING
no output
PHP is a scripting language
GREETING
What will be the output of the following PHP code ?
  1. <?php
  2. define('GREETING_TEST', 'PHP is a scripting language', true);
  3. echo GREETING_TESt;
  4. $changing_variable = 'test';
  5. echo constant('GREETING_' . strtoupper($changing_variable));
  6. ?>

PHP is a scripting language PHP is a scripting language
GREETING_TESt
PHP is a scripting language
PHP is a scripting language GREETING_TEST
What will be the output of the following PHP code ?
  1. <?php
  2. class Constants
  3. {
  4.     define('MIN_VALUE', '0.0');  
  5.     define('MAX_VALUE', '1.0');  
  6.     public static function getMinValue()
  7.     {
  8.         return self::MIN_VALUE;
  9.     }
  10.     public static function getMaxValue()
  11.     {
  12.         return self::MAX_VALUE;
  13.     }
  14. }
  15. echo Constants::getMinValue();
  16. echo Constants::getMaxValue();
  17. ?>

0.01.0
01
no output
ERROR
What will be the output of the following PHP code ?
  1. <?php
  2. define("__LINE__", "PHP is a scripting language");
  3. echo __LINE__;
  4. ?>

PHP is a scripting language
__LINE__
2
ERROR
What will be the output of the following PHP code ?
  1. <?php
  2. define('IF', 42); 
  3. echo "IF: ", IF;
  4. ?>

IF:42
no output
IF:
ERROR
What will be the output of the following PHP code ?
  1. <?php
  2. define("NEW_GOOD_NAME_CONSTANT", "I have a value");
  3. define("OLD_BAD_NAME_CONSTANT", NEW_GOOD_NAME_CONSTANT);
  4. ?
  5. echo NEW_GOOD_NAME_CONSTANT;
  6. echo OLD_BAD_NAME_CONSTANT; 
  7. ?>

I have a value
I have a valueI have a value
ERROR
I have a valueNEW_GOO_NAME_CONSTANTS
What will be the output of the following PHP code ?
  1. <?php
  2. define("VAR_NAME","test"); 
  3. ${VAR_NAME} = "value"; 
  4. echo VAR_NAME;
  5. echo ${VAR_NAME}; 
  6. ?>

test
testtest
testvalue
ERROR, constant value cannot be changed
What will be the output of the following PHP code ?
  1. <?php
  2. class myObject { }
  3. define('myObject::CONSTANT', 'test');
  4. echo myObject::CONSTANT; 
  5. ?>

test
ERROR
myObject::CONSTANT
no output