Fancois, On Apr 9, 2015 10:16 AM, "François Laupretre" <franc...@php.net> wrote: > > > De : Anthony Ferrara [mailto:ircmax...@gmail.com] > > > > If we were using a pure abstraction (only accessing the hash table > > information through the public API), then fine because it's isolated. > > However, many extensions and even places in core access hash table > > structure directly (as can be seen by the updates needed by > > https://github.com/php/php- > > src/commit/2b42d719084631d255ec7ebb6c2928b9339915c2). > > Meaning the complexity isn't encapsulated. > > IMHO, that's the main problem. If a piece of code is accessed through an official published API only, its internal complexity can grow, provided the API still provides the same services. So, the first step should be to define and publish an 'official' full-featured API.
We already have one. The public API defined in zend_hash.h (all methods and macros not prefixed with "_"). And my argument would be if code outside of zend_hash.(c|h) needs to access the internal hash table structure for anything (a public API doesn't serve the needs), then a new macro or API should be introduced for that use-case (so that it doesn't need to access the structure anymore). Anthony