ExamVeda
Login
Home
Operators and Expressions in php
?

What will be the output of the following PHP code ?
<?php
class Constants
{
    define('MIN_VALUE', '0.0');  
    define('MAX_VALUE', '1.0');  
    public static function getMinValue()
    {
        return self::MIN_VALUE;
    }
    public static function getMaxValue()
    {
        return self::MAX_VALUE;
    }
}
echo Constants::getMinValue();
echo Constants::getMaxValue();
?>

Answer & Solution
Correct Answer: Option D
In a class constants should be defined const MIN_VALUE = 0.0;const MAX_VALUE = 1.0; instead.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.