You are viewing a single comment's thread from:

RE: PHP: Use associative arrays basically never

in #php6 years ago

Interesting observation! If you're sorting an array, yes, that would make a big difference. However, the purpose of usort() here was to provide a direct comparison between objects and arrays, so they had to be used in the same way. That meant usort() so that we could compare the property access in each. I didn't as much care about the sorting itself as sorting was an easy way to call $array['a'] and $object->a a few zillion times. :-)

Coin Marketplace

STEEM 0.17
TRX 0.16
JST 0.028
BTC 76338.99
ETH 2965.83
USDT 1.00
SBD 2.62