Re: Class variable unexpected behavior
| From: | Adam Bregenzer | Date: | Sat, 15 May 2004 20:35:43 +0000 |
| Subject: | Re: Class variable unexpected behavior | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-186333@lists.php.net to get a copy of this message | ||
On Sat, 2004-05-15 at 06:24, Richard Shaffer wrote:
> class test {
> var $a;
> var $b = "goodbye";
> function c($arg) {
> $this->$a = $arg;
> echo "<p>a = " . $this->$a . "</p>\n";
> echo "<p>b = " . $this->$b . "</p>\n";
> }
> }
$this->$a should be $this->a
same with '$b': $this->$b should be $this->b
--
Adam Bregenzer
adam@bregenzer.net
http://adam.bregenzer.net/