Ss是可能的, 在不使用C++中的“美元” 等“美元”的情况下, 访问本类方法中的类属性?
小型例子:
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?