I\'ve always heard and searched for new php \'good writing practice\', for example: It\'s better (for performance) to check if array key exists than search in array, but als
Although both arrays are accessed in a different way (i.e. via string or integer value), the memory pattern is mostly similar.
This is because the string allocation either happens as part of the zval creation or when a new array key needs to be allocated; the small difference being that numeric indices don't require a whole zval structure, because they're stored as an (unsigned) long.
The observed differences in memory allocation are so minimal that they can be largely attributed to either the inaccuracy of memory_get_usage() or allocations due to additional bucket creation.
How you want to use your array must be the guiding principle in choosing how it should be indexed; memory should only become an exception to this rule when you run out of it.