Home>Article>Backend Development> Are php function names case sensitive?
PHP’s handling of case-sensitive issues is messy, and problems may occasionally occur when writing code, so this article will summarize it below. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
But I am not encouraging everyone to use these rules. It is recommended that everyone always adhere to "case sensitivity" and follow unified coding standards.
1. Variable names are case-sensitive
2. Constant names are case-sensitive by default and are usually written in uppercase
php.ini configuration item instructions are case-sensitive
For example, file_uploads = 1 cannot be written as File_uploads = 1
3. Function names, method names, and class names are not Case sensitive
But it is recommended to use the same name as when defined
show(); //Output Hello World Recommended writing method
SHOW(); / /Output Hello World
4. Magic constants are not case-sensitive. It is recommended to use uppercase letters
including: __LINE__, __FILE__, __DIR__, __FUNCTION__, __CLASS__, __METHOD__, __NAMESPACE__.
5, NULL, TRUE, FALSE are not case-sensitive
Summary:
In PHP, functions Names (custom and built-in functions), method names, class names, and keywords are not case-sensitive; but variable names are case-sensitive.
The above is the detailed content of Are php function names case sensitive?. For more information, please follow other related articles on the PHP Chinese website!