ID: 25220 Updated by: [EMAIL PROTECTED] -Summary: Staticaly called members can access $this Reported By: php at koert dot bitfactory dot nl -Status: Open +Status: Closed Bug Type: Zend Engine 2 problem Operating System: Cygwin/win2k PHP Version: 5CVS-2003-08-23 (dev) New Comment:
Output with latest CVS: PHP Notice: Undefined property: testclass::$variable in /home/jani/t.php on line 4 Previous Comments: ------------------------------------------------------------------------ [2003-08-23 11:19:11] php at koert dot bitfactory dot nl Description: ------------ If a static method is called from an objectcontext, $this is accessible from that objectcontext. $this should be out of scop in the static method... Reproduce code: --------------- class static_class { function static_func() { echo $this->variable; } } class testclass { function func() { static_class::static_func(); } } $x = new testclass(); $x->func(); Expected result: ---------------- <br /> <b>Fatal error</b>: Using $this when not in object context in <b>[filename]</b> on line <b>2</b><br /> Actual result: -------------- No output (thus no error) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25220&edit=1