|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-10-12 11:59 UTC] zeev
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 15 19:00:01 2025 UTC |
I have checked in the mailings lists and have found no way to do this, only one other user (css - sutherland) complaining about the same. Here goes: How do you assign to an object instance variable within an array? // This is somewhat perverted w.r.t. my orig. code // ... lot of class definitions, db queries and such ... // This is from within a class function. The class has a "has-part" rel. to CartItem $this->items[i] = new CartItem(); $this->items[1]->amnt++; // Parser error $item = $this->items[1]; $item->amnt++; // No parser error, but assignments are by value, so nothing // happens to "items[1] I have also tried fiddling with the {} syntax of $$ variables, but to no avail - help!