#34046 [Opn->Bgs]: $this accessible in static mehods called by an object not instance of this clas
| From: | derick@php.net | Date: | Tue, 09 Aug 2005 07:06:55 +0000 |
| Subject: | #34046 [Opn->Bgs]: $this accessible in static mehods called by an object not instance of this clas | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-83222@lists.php.net to get a copy of this message | ||
ID: 34046
Updated by: derick@php.net
Reported By: bugs dot php dot net at sebastianmendel dot de
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Irrelevant
PHP Version: 4CVS-2005-08-09 (stable)
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
.
Previous Comments:
------------------------------------------------------------------------
[2005-08-09 08:56:07] bugs dot php dot net at sebastianmendel dot de
$this should not be available inside a method called with the
scope-resolution-operator if the call comes from an object not beeing
an instance of the same class as the called method
------------------------------------------------------------------------
[2005-08-09 08:49:57] derick@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
------------------------------------------------------------------------
[2005-08-09 08:49:49] bugs dot php dot net at sebastianmendel dot de
see also answer to bug #9005
http://bugs.php.net/bug.php?id=9005
------------------------------------------------------------------------
[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