ID: 34046 User updated by: bugs dot php dot net at sebastianmendel dot de Reported By: bugs dot php dot net at sebastianmendel dot de Status: Open Bug Type: Scripting Engine problem Operating System: Irrelevant PHP Version: 4CVS-2005-08-09 (stable) New Comment:
see also answer to bug #9005 http://bugs.php.net/bug.php?id=9005 Previous Comments: ------------------------------------------------------------------------ [2005-08-09 08:47:14] bugs dot php dot net at sebastianmendel dot de 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 this bug report at http://bugs.php.net/?id=34046&edit=1