|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-08-09 08:49 UTC] bugs dot php dot net at sebastianmendel dot de
[2005-08-09 08:49 UTC] derick@php.net
[2005-08-09 08:56 UTC] bugs dot php dot net at sebastianmendel dot de
[2005-08-09 09:06 UTC] derick@php.net
[2005-08-09 09:19 UTC] bugs dot php dot net at sebastianmendel dot de
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 23:00:02 2025 UTC |
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