-
What will be the output of the following PHP code ?
<?php
class Constants
{
define('MIN_VA', '10.10');
define('MAX_VAL', '20.20');
public static function getMin()
{
return self::MIN_VAL;
}
public static function getMax()
{
return self::MAX_VAL;
}
}
echo Constants::getMin();
echo Constants::getMax();
?>
-
- Error
- 10.10
- 20.20
- Nothing
- None of these
Correct Option: A
In a class constants should be defined const MIN_VAL = 10.10; const MAX_VAL = 20.20; instead.