#19478 [Opn->Csd]: Two classes error

From: Date: Thu, 03 Oct 2002 09:47:23 +0000
Subject: #19478 [Opn->Csd]: Two classes error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-21362@lists.php.net to get a copy of this message
ID: 19478 Updated by: k.schroeder@php.net Reported By: to@andybutkaj.com -Status: Open +Status: Closed Bug Type: Class/Object related Operating System: Windows 2000 and Windows XP PHP Version: 4.2.2 New Comment: Yes it is. To get 5 for the first example, you must output the value of $y->_value. Regards, Kai Previous Comments: ------------------------------------------------------------------------ [2002-09-18 11:26:15] to@andybutkaj.com class test { var $_value; function test_static ($to) { $this->_value = $to; } } class test2 { var $_value; function use_test () { $this->_value = 7; $y = new test(); $y->test_static(5); echo "<p>value: ".$this->_value."</p>"; test::test_static (5); echo "<p>value: ".$this->_value."</p>"; } } $x=new test2(); $x->use_test(); First echo returns value 7 Second echo returns value 5 is this correct? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19478&edit=1

« previous php.bugs (#21362) next »