<?php
class Worker {
	public $name;
	public $salary;
	//public $type;

	public function __construct(int $type, array $types)  {
		$this->name = $types[$type]['name'];
		$this->salary = $types[$type]['salary'];
		
	}
}

$types = [
	1 => ['name' => 'engineer', 'salary' => 100],
	2 => ['name' => 'marketer', 'salary' => 200],
];

$a = new Worker(1, $types);

var_dump ($a);