For example I feel pretty sure that it is a wrong choice to give a very long name “htmlspecialchars” to a function that should be used very often by people who mix their code with page design (most of PHP users). Abbreviating that to “html” would be an improvement.
Inconsistent function naming, such as “isset” but “is_null”; “strlen”, “strpos” but “str_repeat”, “str_strip” also does not provide an advantage. For the new language I would use one of those choices (but silently support the other one as a synonym, for former PHP users).
Is that the only function that starts with “html”?
There are two functions starting with html: “htmlentities” and “htmlspecialchars”. They do almost the same thing.
Is “html” a common variable name?
Variables in PHP must start with $, so it could be only “$html”. There is no possible conflict.
By the way, I think this language design choice is good… well, I would hate to see it in my favourite language, but for a typical PHP user it is probably good that something prevents possible conflicts between variables and other things (functions, keywords, class names).
Some things in PHP can be defended as “better for beginners”, especially for people who actually never want to learn programming beyond using the google-copy-paste pattern. But some things are just pure stupidity, and those should be fixed. And I don’t expect that the authors of PHP will ever fix them; they just seem to make more stupid choices in every new version.
This needs to be examined feature by feature.
For example I feel pretty sure that it is a wrong choice to give a very long name “htmlspecialchars” to a function that should be used very often by people who mix their code with page design (most of PHP users). Abbreviating that to “html” would be an improvement.
Inconsistent function naming, such as “isset” but “is_null”; “strlen”, “strpos” but “str_repeat”, “str_strip” also does not provide an advantage. For the new language I would use one of those choices (but silently support the other one as a synonym, for former PHP users).
Is that the only function that starts with “html”? Is “html” a common variable name?
I agree that this is a stupid design choice.
There are two functions starting with html: “htmlentities” and “htmlspecialchars”. They do almost the same thing.
Variables in PHP must start with $, so it could be only “$html”. There is no possible conflict.
By the way, I think this language design choice is good… well, I would hate to see it in my favourite language, but for a typical PHP user it is probably good that something prevents possible conflicts between variables and other things (functions, keywords, class names).
Some things in PHP can be defended as “better for beginners”, especially for people who actually never want to learn programming beyond using the google-copy-paste pattern. But some things are just pure stupidity, and those should be fixed. And I don’t expect that the authors of PHP will ever fix them; they just seem to make more stupid choices in every new version.