I have an array of objects. The objects mainly have a bunch of properties because these are meta-data objects.
so it is like
$objects[]
is like a bunch of items that have properties like:
object->item1
, object->item2
, etc.
I want to add something to each of these objects, so...
foreach ($objects as &$object) {
$object->newItem=(something I compute);
}
then later, I want to display these objects as a list in html. So, I go:
foreach ($objects as $object) {
<li><?php object output stuff here ?></li>
}
ok. Now, it works fine, except the last object is discarded and the second to last object is displayed twice. WTF??
Does this make sense to you?