ID: 29294 Updated by: [EMAIL PROTECTED] Reported By: pterjan at linuxfr dot org -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: GNU/Linux PHP Version: 4.3.8 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Has been like this in PHP 4 too and we didn't want to break it in PHP 5. Previous Comments: ------------------------------------------------------------------------ [2004-07-21 12:30:58] pterjan at linuxfr dot org 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29294&edit=1