Something I haven't seen a lot of on Google search or anything is questions about PHPs max class handling at runtime.
Say I have a custom arrayaccess class that could house upto 8k objects of type "User".
Since the arrayaccess
class does not allow me to do:
$d[0]->username = "sam"
And set the class only for a residual object like I can in iterator when you do a foreach()
each loop brings out an object but the array itself has got no objects in, it just assigns a new populated object (allowing you to reuse the same spot in memory over and over) in each loop of the array. I can only set a object in the offsetGet()
method within the offset of the array within the arrayaccess
class. Due to this I would need to house anything upto 8K objects at any one point within this arrayaccess
class (maybe even 20k objects).
So each offset in my arrayaccess
class could be an object of say "User" and there could be upto 20k of them (8k at least).
My Question is: Would PHP be able to handle this amount of class instances? I mean this is a lot of classes and I am worried it could easily ruin my memory consumption.