I have an object that is being thrown into the session array, and I want to run a foreach on the items property.
I can\'t seem to access it. I see that it\'s priva
That's the idea of private properties: You can't access them. You should really not break this concept. If you really want to access such property, mark is as "public" in the original class definition.
The reason why var_dump can access it is because it is an internal function, and it has the "power" to view the whole object. However, your code doesn't have that power.
I wouldn't recommend it, but if you really need to access a private property, you can use PHP Reflection to achieve it.