<?php
error_reporting(-1);
mb_internal_encoding('utf-8');
//------------------Стал выдавать ошибку после добавления кода с 5 по 31 строку.
abstract class Department {
    public $employees = array();
    public $moneyConsumption;
    public $coffeeConsumption;
    public $reportsGeneration;
    public $toogreeksPerPage;
    
    public function name () {
        
    }
}
class Purchasing extends Department {
    public function __construct() {
        while ($i < 9)
        $this->employees[] = new Manager(1, false);
        $i = $i + 1;
    }
}
class Sales extends Department {
    
}
class Marketing extends Department {
    
}
class Logistics extends Department {
    
}
//----------------------------------------------------------------------------->
abstract class Employee {
    public $rank;
    public $isBoss;
    public $salary;
    public $coffee;
    public $reports;
    
    public function getSalary($salary) {
        if ($this->rank == 1) {
            $result = $salary;
        }elseif ($this->rank == 2) {
            $result = $salary * 1.25;
        }elseif ($this->rank == 3) {
            $result = $salary * 1.5;
        }
        if ($this->isBoss == true) {
            $result = $result * 1.5;
        }
        return $result;
    }
    public function getCoffee($coffee) {
        if ($this->isBoss == true) {
            $result = $coffee * 2;
        }
        return $result;
    }
    public function getReports($reports) {
        if ($this->isBoss == true) {
            $result = 0;
        }
        return $result;
    }
}

class Manager extends Employee {
    public function __construct($rank, $isBoss) {
    	$salary = 500;
    	$coffee = 20;
    	$reports = 200;
        $this->rank = $rank;
        $this->isBoss = $isBoss;
        $this->salary = $this->getSalary($salary);
        $this->coffee = $this->getCoffee($coffee);
        $this->reports = $this->getReports($reports);
    }
}
class Marketer extends Employee {
    public function __construct($rank, $isBoss) {
    	$salary = 400;
    	$coffee = 15;
    	$reports = 150;
        $this->rank = $rank;
        $this->isBoss = $isBoss;
        $this->salary = $this->getSalary($salary);
        $this->coffee = $this->getCoffee($coffee);
        $this->reports = $this->getReports($reports);
    }
}
class Engineer extends Employee {
    public function __construct($rank, $isBoss) {
    	$salary = 200;
    	$coffee = 5;
    	$reports = 50;
        $this->rank = $rank;
        $this->isBoss = $isBoss;
        $this->salary = $this->getSalary($salary);
        $this->coffee = $this->getCoffee($coffee);
        $this->reports = $this->getReports($reports);
    }
}
class Analyst extends Employee {
    public function __construct($rank, $isBoss) {
    	$salary = 800;
    	$coffee = 50;
    	$reports = 5;
        $this->rank = $rank;
        $this->isBoss = $isBoss;
        $this->salary = $this->getSalary($salary);
        $this->coffee = $this->getCoffee($coffee);
        $this->reports = $this->getReports($reports);
    }
}

$purchasing = new Purchasing;
var_dump($purchasing);