#19194 [Fbk->Csd]: Static class usage, maybe bug maybe not
| From: | sniper@php.net | Date: | Fri, 27 Sep 2002 00:55:35 +0000 |
| Subject: | #19194 [Fbk->Csd]: Static class usage, maybe bug maybe not | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-20518@lists.php.net to get a copy of this message | ||
ID: 19194
Updated by: sniper@php.net
Reported By: Jevgenijs.Junkins@verdi.lv
-Status: Feedback
+Status: Closed
Bug Type: Scripting Engine problem
Operating System: Corel Linux
PHP Version: 4.2.2
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2002-09-09 10:46:44] stas@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
Works for me with latest CVS (i.e., says "do something").
------------------------------------------------------------------------
[2002-08-30 05:59:39] Jevgenijs.Junkins@verdi.lv
I have a problem with static method usage (Classname::methodname())
here are two classes, for example:
<code>
class test1 {
var $prop1;
var $prop2;
function test1($val1, $val2){
$this->prop1 = $val1;
$this->prop2 = $val2;
}
function test_method(){
if($this){
var_dump($this);
}
else {
echo "do something"
}
}
}
class test2 {
function test2(){
}
function run(){
test1::test_method();
}
}
t_obj = new test2();
t_obj->run();
</code>
I will always get output of var_dump, because in method of test1
test_method() $this is always set and it is reference or copy of
initialized test2 class
Check of $this in test_method is required to check if it is static call
or from this object, but it does not work, I think this is not correct
behavior
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19194&edit=1