samedi 6 décembre 2014

Itterating over an object's array


Vote count:

0




I have a class called User which has an array of products(objects).


Somewhere else I have an array of users. The problem is that I want to have acces to products[0] of users[0].


`$users[0] = new User("ion","ion123","seller",$productsUser0);



//construct allProducts array
$allProdCounter = 0;
$usr = $users[0];
$prodArray = &$users[0]->productsArray;
print_r($prodArray);


` When I run the cod, there appears the following error: Indirect modification of overloaded property User::$productsArray has no effect


What is the problem?



asked 53 secs ago







Itterating over an object's array

Aucun commentaire:

Enregistrer un commentaire