bar; } } $f = new Foo; var_dump($f->getBar()); // Output: // string("bar")