I was working on a function, that ends up adding a massive amounts of dimensions to an array, and I was wondering, is it possible to reach a limit on how many dimensions can be added, and if so, what is that limit in PHP?
3
-
If you have to ask, you're probably adding too many things into the array. :o) I don't think there's a limit though, apart from the raw physical memory the machine has.deceze– deceze ♦2012-02-01 00:46:58 +00:00Commented Feb 1, 2012 at 0:46
-
Depends how much memory you've got ;)Abe Petrillo– Abe Petrillo2012-02-01 00:47:05 +00:00Commented Feb 1, 2012 at 0:47
-
stackoverflow.com/questions/467149/…Zul– Zul2012-02-01 00:53:43 +00:00Commented Feb 1, 2012 at 0:53
Add a comment
|
1 Answer
No, I don't believe there's a limit to the depth of access (save for how much RAM you've got).
Each level adds at least one pointer indirection, though, so the speed of retrieving elements will suffer as you get deeper.
I'd be willing to bet dollars to donuts there's an easier way to store and manipulate the data you think you need this super-array for.