Designed for storing large datasets as an array.
Please note: If you have a very large array, consider reevaluating your architecture rather than using this code. Use this library only in exceptional cases.
You can install this package via Composer:
composer require drlenux/large-array
use Drlenux\LargeArray\LargeArray;
$array = new LargeArray(/** optional salt **/);
$array = new LargeArray('for report');
for ($i = 0; $i < 1_000_000; $i++) $array[] = $i;
$array['test'] = 'test value';
$array['sub']['array'] = true; // don't use, 'cause return null
$array['sub'] = ['array' => true]; // it's correct
$array->in(5000); // result: true [instead of in_array]
$array[5000] // result: 5000
$array['test'] // result: test value
LargeArray use interface ArrayAccess, Countable, Iterator
If you discover any security-related issues, please email oleksii@bielokudrenko.family instead of using the issue tracker.
This package is open-source software licensed under the MIT license.