I saw this post, but didn't quite understand it and it didn't quite answer my question. Also - it seems to suggest that arrays are slower. I thought: that cannot be!
When all else is equal, and when aiming for speed, what is the best way to assign variables in an array?
Is this better:
$part1 = "a";
$part2 = "b";
$part3 = "c";
$part4 = "d";
(Sure, I know this doesn't allow you to interact with the data like you would with an array, but let's say you didn't need to.)
Is this better:
$part[1] = "a";
$part[2] = "b";
$part[3] = "c";
$part[4] = "d";
Is this better:
$part = array("a","b","c","d");
Or something else? And what are the mechanics behind why one is better than the others?
Also - does it depend on the number of elements being assigned? How does the answer change when talking about multidimensional arrays, different data types, or different languages? Also, does it change if I initialize the array then add elements to it?