From: php at koert dot bitfactory dot nl
Operating system: Cygwin/win2k
PHP version: 5CVS-2003-08-23 (dev)
PHP Bug Type: Zend Engine 2 problem
Bug description: Staticaly called members can access $this
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 bug report at http://bugs.php.net/?id=25220&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25220&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25220&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25220&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25220&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25220&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25220&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25220&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25220&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25220&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25220&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25220&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25220&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25220&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25220&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25220&r=gnused