Jump to content

multi-dimensional


TheFilmGod

Recommended Posts

Are multi-dimensional arrays in the $_SESSION super global slow?

 

Here's one I want to use:

 

$_SESSION['process']['setup']['data']['first_name']

 

That's probably the deepest I will go. I can get this to work without a problem, but are 4 dimensional arrays fast? I do not want poor performance to be given up in exchanged for a more organized coding strategy.

Link to comment
Share on other sites

Are multi-dimensional arrays in the $_SESSION super global slow?

 

Here's one I want to use:

 

$_SESSION['process']['setup']['data']['first_name']

 

That's probably the deepest I will go. I can get this to work without a problem, but are 4 dimensional arrays fast? I do not want poor performance to be given up in exchanged for a more organized coding strategy.

 

It depends purely on the data that is placed within it. Looking at your session arrays, It would be safe to say that you are not passing hundreds of thousands of array keys at a time in place of a database or whatnot.

 

To answer your question it should not matter at all with speed how deep your array is unless it has an obtuse amount of data.

Link to comment
Share on other sites

Are multi-dimensional arrays in the $_SESSION super global slow?

 

Here's one I want to use:

 

$_SESSION['process']['setup']['data']['first_name']

 

That's probably the deepest I will go. I can get this to work without a problem, but are 4 dimensional arrays fast? I do not want poor performance to be given up in exchanged for a more organized coding strategy.

 

It depends purely on the data that is placed within it. Looking at your session arrays, It would be safe to say that you are not passing hundreds of thousands of array keys at a time in place of a database or whatnot.

 

To answer your question it should not matter at all with speed how deep your array is unless it has an obtuse amount of data.

 

Good point. I finally found some stuff on google about this (had to use different keywords) and I found out that all php variables are serialized before storage. This means that the depth of my multi-dimensional array doesn't matter - as long as there isn't too much data.

 

Thank you!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.