PHP class properties without "$this"

php

Solution

No. It is not. In PHP, you have to use the `$this->` syntax to access instance variables.

Problem

Ss is possible, to access class properties inside this class methods without using "$this", like in C++? Small example: ``` class MyClass { protected $foo = 'abc'; protected $bar = 'dca'; public function __construct() { $foo = 'Hello'; $bar = 'World!'; } public function display() { echo $foo . ' ' . $bar; } } $MyObject = new MyClass(); $MyObject->display(); ``` In result, I have notices about undefined variables. But I'ld like to be sure - is it possible, or not?

Original source