Just out of curiosity,
Does the alias of a built-in PHP function take any more power than the regular function itself.
AKA, does sizeof() take more time than count() to run?
Note to Micro-Optimization Police: Unless there is a HUGE difference, I don’t plan on trying to micro-optimize my script. Was just curious.
Note to the ‘Just try it yourself’ Police: I’m not able to access a PHP environment right now.
It seems that this has also expanded to a ‘Best Pratice’, as PHP’s documentation states that aliases are best not used, and in turn should simply be called via the master function. In this case, that would mean that count() should be used over sizeof().
It is my understanding that aliases are typically the result of a couple different things. For instance, when name-conventions change, or function-names themselves change. It would be disastrous to eliminate the old convention immediately. Additionally, they are helpful for users who come from a different language background, and would like to use many of the same familiar methods they’re already used to.
I don’t think there’s any additional overhead. But be sure to check the official documentation for which method/function name is encouraged as deprecation is always potentially looming in the uncertain future.