I remember that some time ago, when I was starting programming with PHP, I saw in some tutorials a recommendation, warning that it was to avoid using some functions that are nicknames for others.
I do not know if I'm wrong, but in the PHP Manual itself, when you entered the page of a function that was an alias (such as session_commit
and sizeof
), it had a warning something like this: / p>
The
y
function is a nickname for thex
function, so its use should be avoided as it can be removed in future versions.
I may be wrong, but I get the impression that there was a time when I would comment that new php versions would remove all aliases from functions, to make things more organized .
But what I've noticed is that even after PHP 7 is released, function aliases are still there, and there is no recommendation when to use them.
Examples:
I wonder if there is any danger in using these synonymous / nickname functions, because of the risk of being removed in the future.
Using function aliases could be bad also from the point of view of some coding standard in PHP, such as the PSR?
For example, would you have any problem using sizeof
instead of count
?