Re: mysterious behaving an "manual array push" - Cannot use [] for reading in...
| From: | clayton collie | Date: | Tue, 11 Jul 2000 16:35:16 +0000 |
| Subject: | Re: mysterious behaving an "manual array push" - Cannot use [] for reading in... | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-24200@lists.php.net to get a copy of this message | ||
i assume you know that the proper syntax for class field deref is
$this->var
instead of
$this-$var
clayton
waldschrott <waldschrott@kiffen.de> wrote in message
news:396B4953.2060705@kiffen.de...
> Why do I get this error "Cannot use [] for reading in..."?
> Changing the code below to use
> array_push($this->$val,$nr);
> solves the problem...
>
> <?php
> class a {
> function a($nr) {
> $var='test';
> $this->$val[]=$nr; }}
> new a();
> ?>
>
> regards
>
> --
> o----------0-¬---------O-·---¬----o---®-----o o O ° .
> | http://www.kiffen.de | pRoteçt y0ur bRaín |0 O ° ¤
> ° ·
>
> 0°·³°²'²³-¹'³´³°^°³~³²³°'³²²¨³²^³¹³²°²³`³º³°Þ °
> o © ° . ·
> | psychedelic experience | gott@kiffen.de | O ° o °
> o-¬--o--0-----©-·--O-----o-----0-¤----------o 0 ° · ° . ¤ ·
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>