PHP :: Bug #65911 :: scope resolution operator
[2013-10-16 09:23 UTC] ori at uumpa dot com
Description:
------------
When using the scope resolution operator with $this it ignores everything before the scope operator and just returns whatever is after the scope operator
for example, if we are inside an object with attribute foo:
STATIC_CLASS::$this->foo
the above script returns $this->foo
I assume it should raise an error (Access to undeclared static property)
Test script:
---------------
class A {}
class B
{
public function go()
{
$this->foo = 'bar';
echo A::$this->foo; // 'bar'
}
}
$obj = new B();
$obj->go();
Expected result:
----------------
it should raise a fatal error - Access to undeclared property A::$this
Actual result:
--------------
It does not raise an error and just echoes 'bar'