1. Go to this page and download the library: Download dasprid/enum library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
function tellItLikeItIs(WeekDay $weekDay)
{
switch ($weekDay) {
case WeekDay::MONDAY():
echo 'Mondays are bad.';
break;
case WeekDay::FRIDAY():
echo 'Fridays are better.';
break;
case WeekDay::SATURDAY():
case WeekDay::SUNDAY():
echo 'Weekends are best.';
break;
default:
echo 'Midweek days are so-so.';
}
}
tellItLikeItIs(WeekDay::MONDAY());
tellItLikeItIs(WeekDay::WEDNESDAY());
tellItLikeItIs(WeekDay::FRIDAY());
tellItLikeItIs(WeekDay::SATURDAY());
tellItLikeItIs(WeekDay::SUNDAY());