|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-07-21 22:52 UTC] derick@php.net
[2004-07-22 00:08 UTC] schlueter at phpbar dot de
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 01:00:02 2025 UTC |
Description: ------------ When a method is called outside any instance, I would expect $this not being defined, however, if the method is called from another object, it will point to the caller. Is it intended ? Reproduce code: --------------- <?php class Plop { function coin(){ echo get_class($this); } } class Foo { function plop(){ Plop::coin(); } } $foo =& new Foo(); $foo->plop(); ?> Expected result: ---------------- Nothing Actual result: -------------- foo