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.
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.