PHP - Classes and Objects
Consider this PHP code:
What is the output?
class Status {
const OK = 1;
const ERROR = 0;
public static function getMessage($code) {
return match($code) {
self::OK => 'Success',
self::ERROR => 'Failure',
default => 'Unknown'
};
}
}
echo Status::getMessage(Status::OK);What is the output?
