5 ms·
In PHP you can mix the types of the key, so that won't work.
by lysium 15y ago
In PHP you can mix the types of the key, so that won't work.
- lysium 15y agoIn another thread, dchest points out http://news.ycombinator.com/item?id=3360369 http://news.ycombinator.com/item?id=3360369 that Lua 5.0 allows mixed-typed keys, too, so that may work.
- obtu 15y agoYes. You can specialise the implementation without breaking semantics. Lua, PyPy, and some Javascript VMs are examples of that.
- deleted 15y ago[deleted]
- deleted 15y ago[deleted]
- wotnarg 15y agoYou can mix types and specialize; HipHop does. The key is that the implementation needs to be able to switch array types on the fly and convert itself. In the common case, using a specialized array will be big wins in space and time, and in the uncommon case, it can revert to a generic version.