class A {
protected $bar = 'bar';
public function foo() {
echo $this->$bar;
}
}
$a = new A();
$a->foo();
It's boggling my mind that this isn't working. I come from C++ and C# so it's likely something I don't understand about PHP.