Re: [PHP4BETA] Objects corrupted
| From: | John Steele | Date: | Fri, 21 Apr 2000 08:26:50 +0000 |
| Subject: | Re: [PHP4BETA] Objects corrupted | ||
| References: | 1 2 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-13899@lists.php.net to get a copy of this message | ||
For Szii,
This doesn't even parse on my machine. See corrections below (no corruption here):
>> class whee
>> {
>> var one;
>> var two;
>> var three;
var $one;
var $two;
var $three; /* notice $ for vars */
>> function whee()
>> {
>> $this->$one = 'one';
>> $this->$two = 'two';
>> $this->$three = 'three';
$this->one = 'one';
$this->two = 'two';
$this->three = 'three'; /* notice $ only on $this */
>> }
>>
>> function query()
>> {
>> echo "$this->$one, $this->$two, $this->$three";
echo "$this->one, $this->two, $this->three"; /* see above */
>> }
>> }
>>
>> Three looks okay, but 1 & 2 don't hold values.
Works fine here with these changes (PHP4.0RC1, win95),
John
--
/* SteeleSoft Consulting John Steele - Systems Analyst/Programmer
* We also walk dogs... jsteele@writeme.com
* http://www.gamecomputer.com/ssc/
*/