#34046 [NEW]: $this accessible in static mehods called by an object not instance of this clas

From: Date: Tue, 09 Aug 2005 06:47:15 +0000
Subject: #34046 [NEW]: $this accessible in static mehods called by an object not instance of this clas
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-83217@lists.php.net to get a copy of this message
From: bugs dot php dot net at sebastianmendel dot de Operating system: Irrelevant PHP version: 4CVS-2005-08-09 (stable) PHP Bug Type: Scripting Engine problem Bug description: $this accessible in static mehods called by an object not instance of this clas Description: ------------ $this is available inside a statically called mehod when it is called from inside an object not an instance of this class Reproduce code: --------------- <?php class Foo { function foo() { if ( isset( $this ) ) { return '$this available'; } else { return '$this NOT available'; } } } class Bar { function callFoo() { echo 'Foo::foo(): ' . Foo::foo() . "\n"; } } $foo = new Bar(); $foo->callFoo(); ?> Expected result: ---------------- Foo::foo(): $this NOT available Actual result: -------------- Foo::foo(): $this available -- Edit bug report at http://bugs.php.net/?id=34046&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34046&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34046&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34046&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34046&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34046&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34046&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34046&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34046&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34046&r=support Expected behavior: http://bugs.php.net/fix.php?id=34046&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34046&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34046&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34046&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34046&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34046&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34046&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34046&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34046&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34046&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34046&r=mysqlcfg

« previous php.bugs (#83217) next »