class calendar {     protected $holidays = array(); protected $year = 0;     /**      * calendar constructor.      * @param int|string $year      */     public function __construct( $year = 0 )     {         $this->year = ( $year == 0 ) ? date( 'Y' ) : $year;         // feste Feiertage definieren         $this->holidays[] = '01.01.'; // Neujahr         $this->holidays[] = '01.05.'; // Tag der Arbeit         $this->holidays[] = '03.10.'; // Tag der Deutschen Einheit         $this->holidays[] = '25.12.'; // 1. Weihnachtsfeiertag         $this->holidays[] = '26.12.'; // 2. Weihnachtsfeiertag         // alle beweglichen Feiertage von Karfreitag bis Pfinstmontag         $easterSunday = date( 'd.M.Y', easter_date( $this->year ) );         foreach( array( -2, 1, 39, 49, 50 ) as $day )         {             $time = array( $easterSunday, $day, 'day');             $ts = strtotime( implode( ' ', $time ) );             $this->holidays[] = date( 'd.m.', $ts );         }     }     /**      * @param int $timestamp      * @return bool      */     public function isHoliday( $timestamp )     {         $date = date( 'd.m.', $timestamp );         return in_array( $date, $this->holidays );     } }