$a = array( 'host' => 'www.phpfreaks.com', 'path' => 'forums', 'file' => 'index.php', 'args' => 'action=post', 'count' => 5, 'potatoes' = true, ... etc etc );
Are there any extensions for php which allow for more efficient data storage, at the expense of reduced flexibility? I am looking for something similar to a C structure, where data is tightly packed, and names for the elements do not need to be stored.
The structure needs to support:
- Inserting at the end of the array
- Fetching data from any location in the array (indexed by integers, like a C array)
- Sorting (this could be complex)
My main concern is that the labels for each data item (such as 'host', 'path') are repeates for EVERY element in my array $a. This is a painful waste of space. My secondary concern is that I do not want to use an entire zval to store a simple boolean, or a simple integer. I would like to pack these values more tightly, even if accessing them becomes more costly.
Thanks for any advice