fork download
  1. <?php
  2. <?php
  3. class Direction {
  4. public $departments = array();
  5.  
  6. public function dismissEmployees($type) {
  7. $filteredEmployees = array();
  8.  
  9. foreach ($this->departments as $departmentkey => $department) {
  10. $filteredEmployees = array_filter($department->employees, function($f) use ($type) {return ($f->name == $type) and ($f->leader != true);});
  11. $totalEmployeesType = count($filteredEmployees);
  12.  
  13. if($totalEmployeesType == 0) {
  14. continue;
  15. }
  16.  
  17. $percent = ceil(($totalEmployeesType / 100) * 40);
  18.  
  19. usort($filteredEmployees, function($a, $b) {
  20. if ($a->rang == $b->rang) {
  21. return 0;
  22. }
  23.  
  24. return ($a->rang < $b->rang) ? -1 : 1;
  25. });
  26.  
  27. $focusEmployees = array_slice($filteredEmployees, 0, $percent);
  28.  
  29. $department->employees = array_udiff($department->employees, $focusEmployees, function($a, $b) {return ($a != $b);});
  30. }
  31.  
  32. return true;
  33. }
  34. }
Runtime error #stdin #stdout #stderr 0.02s 24448KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Parse error:  syntax error, unexpected '<' in /home/Uuz4vE/prog.php on line 2