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
https://forums.phpfreaks.com/topic/188400-multi-dimensional/
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
https://forums.phpfreaks.com/topic/188400-multi-dimensional/#findComment-994585
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
https://forums.phpfreaks.com/topic/188400-multi-dimensional/#findComment-994587
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.