<?php
  class Employee {
    public $name;
    public $department;

    function __construct($name, $department) {
      $this->name = $name;
      $this->department = $department;
    }
    function showBadge() {
      if ($this->name == "" || $this->department == "") {
        throw new Exception("Name and department are required.");
      }
      echo "Name: ".$this->name."<br>";
      echo "Department: ".$this->department."<br>";
    }
  }
?>