3

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. Commented Feb 1, 2012 at 0:46
  • Depends how much memory you've got ;) Commented Feb 1, 2012 at 0:47
  • stackoverflow.com/questions/467149/… Commented Feb 1, 2012 at 0:53

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.