Home>Article>Backend Development> Are php function names case sensitive?

Are php function names case sensitive?

青灯夜游
青灯夜游 Original
2019-10-10 13:58:09 6491browse

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.

Are php function names case sensitive?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:When was php7 released? Next article:When was php7 released?