ID: 34833
User updated by: stochnagara at hotmail dot com
Reported By: stochnagara at hotmail dot com
Status: Bogus
Bug Type: Class/Object related
Operating System: windows xp
PHP Version: 5.1.0RC1
New Comment:
Actually "Won't Fix" is a better bug status since it is not an expected
behaviour. I expect an error message for example:) But that's not
important.
Previous Comments:
------------------------------------------------------------------------
[2005-10-11 21:26:04] [EMAIL PROTECTED]
Declare static methods as static, this way there won't be $this at
all.
This is done to keep BC with PHP4 and won't change in the nearest
future.
------------------------------------------------------------------------
[2005-10-11 21:18:27] stochnagara at hotmail dot com
Description:
------------
$this is assigned incorrectly. See the sample code below.
Reproduce code:
---------------
<?
class abc {
function a() { echo "abc::a\n"; $this->b(); }
function b() { echo "abc::b\n"; }
}
class def {
function c() { echo "def::c\n"; abc::a(); }
}
$test = new def();
$test->c();
Expected result:
----------------
def::c abc::a
some error message
Actual result:
--------------
def::c abc::a
Fatal error: Call to undefined method def::b() in ...php on line 4
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34833&edit=1