You are viewing a single comment's thread from:

RE: PHP: Use associative arrays basically never

in #php6 years ago

Nice benchmark !

And what about extending Serializable on the named class to still store it as an associative array ?

Is it the best win-win combo ? Of course we need to ask if defining serialization for simple data struct is relevant 😊.

Sort:  

My guess is it would be slower because it has to call serialize/deserialize in user-space for each class. It might end up being smaller but the performance cost is likely not worth it. That said, I haven't tried.