    <?php
    
    class Worker {
    	// An array with workers
	    protected $workers = array(
	    	'engineer' => array(
	    		'salary' => 100
	    	),
	    	
	    	'marketer' => array(
	    		'salary' => 200
	    	)
	    );
	    
	    // An array of worker params
	    protected $current_worker;
     
     	/**
     	 * Worker constructor.
     	 */
    	public function __construct( $job_title = 'marketer' )  {
    		// Check if such position exists
    		if ( array_key_exists( $job_title, $this->workers ) ) {
    			// Assign job title
    			$this->current_worker = $this->workers[$job_title];
    		} else {
    			throw new Exception( 'Passed job title does not exist!' );
    		}
    	}
    	
    	/**
    	 * Getter for worker salary
    	 */
    	public function get_worker_salary() {
    		// Check if salary key exists
    		if ( array_key_exists( 'salary', $this->current_worker ) ) {
    			return $this->current_worker['salary'];
    		} else {
    			return false;
    		}
    	}
    }
     
    $Vasya = new Worker( 'engineer' );
    echo $Vasya->get_worker_salary();