<?php

class Target {
	public $var = 'Target var';
}

class Test {
	public $leftAttribute = 'var';
	public function run() {
		$target = new Target;
		echo $target->var, PHP_EOL;
		echo $this->leftAttribute, PHP_EOL;
		echo $target->{$this->leftAttribute};
	}
}

(new Test)->run();