TheFilmGod Posted January 14, 2010 Share Posted January 14, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/188400-multi-dimensional/ Share on other sites More sharing options...
oni-kun Posted January 14, 2010 Share Posted January 14, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/188400-multi-dimensional/#findComment-994585 Share on other sites More sharing options...
TheFilmGod Posted January 14, 2010 Author Share Posted January 14, 2010 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! Quote Link to comment https://forums.phpfreaks.com/topic/188400-multi-dimensional/#findComment-994587 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.