#19980 [Opn->Fbk]: Static method call from non-statiic method fails.
| From: | tal@php.net | Date: | Fri, 18 Oct 2002 15:26:32 +0000 |
| Subject: | #19980 [Opn->Fbk]: Static method call from non-statiic method fails. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-22776@lists.php.net to get a copy of this message | ||
ID: 19980
Updated by: tal@php.net
Reported By: xczimi@sztaki.hu
-Status: Open
+Status: Feedback
Bug Type: Scripting Engine problem
Operating System: Win2000
PHP Version: 4.2.3
New Comment:
And the output is?
Previous Comments:
------------------------------------------------------------------------
[2002-10-18 10:07:33] xczimi@sztaki.hu
when calling B::procSave from $a->procSave() the $this keeps linked to
$a.
The code:
<?php
class A {
function A() {}
function procSave() {
echo "A";
if(isset($this)) echo "y"; else echo "n";
B::procSave();
}
}
class B {
function B() {}
function procSave() {
echo "B";
if(isset($this)) echo "y"; else echo "n";
}
}
$a = new A();
$b = new B();
$a->procSave();
B::procSave();
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19980&edit=1