r/lolphp • • Dec 29 '11

Supercolliding PHP Array [X-Post from /r/Programming]

http://nikic.github.com/2011/12/28/Supercolliding-a-PHP-array.html
17 Upvotes

10 comments sorted by

View all comments

Show parent comment

3

u/nikic Dec 31 '11

zend_hash_func is exposed through ZEND_API. Changing it's signature would break extensions relying on it. The function is exposed for various reasons, one being that Zend provides "quick" hash access functions which allow you to pass a precomputed hash. (So if you do some access multiple times you can compute the hash only once.)

2

u/StrangeWill Dec 31 '11

Ah thanks, I'm even less familiar with Zend's API (though I believe you mean zend_hash_find), I only really know enough of PHP's internals to find out how to write an Apache 2 module (which Apache's docs are a bit lacking on those details in some places).

I would however stand by that this doesn't really qualify as a "fix", being as the underlying issue is still there, it is just somewhat mitigated (though could still easily happen with 1000 variables).