|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2013-10-16 16:42 UTC] nikic@php.net
[2013-10-16 16:42 UTC] nikic@php.net
-Status: Open
+Status: Closed
[2014-10-07 23:16 UTC] stas@php.net
[2014-10-07 23:27 UTC] stas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 14:00:01 2025 UTC |
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'