dev-master
9999999-dev https://github.com/alanevans/string-array
MIT
The Requires
- php >=5.3.0
The Development Requires
- pdepend/pdepend ~1.0
- phploc/phploc ~2.0
- phpmd/phpmd ~1.0
- phpunit/phpunit ~3.0
- scrutinizer/ocular ~1.0
- sebastian/phpcpd ~2.0
This is an experimental library that intends to provide access to a C-like array within PHP. I cannot say whether this is a good idea or not, it mainly depends on your use case., (*2)
The current implementation uses a PHP string to avoid the memory overhead of using PHP's native hash table of Zvals to implement an array of arrays. This sacrifices speed for memory., (*3)
For even more (and slower) memory, you could consider shifting parts of the string off into files., (*4)
As an informal example, a 10000x1000 StringArray (10,000,000 data cells) takes about 40MB and takes about 10s to populate on an ok-ish laptop. The same in nested PHP arrays can be done in about half the time, but takes 1.4GB. I can easily test a StringArray of 10000x10000, which takes about 400MB, but it becomes prohibitive to test that size of array with native PHP arrays., (*5)
The question might well be "what possible use case requires that much memory but can afford to take that much time?" Well, I leave that up to you., (*6)
string-array can be installed with Composer by adding it as a dependency to your project's composer.json file., (*7)
{ "require": { "ale/string-array": "*" } }
Please refer to Composer's documentation for more detailed installation and usage instructions., (*8)
@todo, (*9)
I'm not sure when any of these will get done., (*10)
MIT