The FAQ states that solutions like FFI are not allowed because the goal is to solve it with PHP :)
What about using the filesystem as an optimized dict implementation?
What about using the filesystem as an optimized dict implementation?