Summary of PHP case sensitivity issues

Source: Internet
Author: User
Summary of PHP case sensitivity issues
Php is case sensitive to variables and constants. The method name is case-insensitive to the class name. It is not sensitive to null, false, true, and other parameters. it is also sensitive to configuration parameters in php. ini. This article summarizes this issue.

This article is a summary of whether php is case sensitive. However, we recommend that you always adhere to "case sensitivity" and follow the unified code specifications. I. case sensitivity: 1. variable names are case sensitive.

     

2. the constant name is case-sensitive by default. it is usually written in uppercase (but the default configuration item cannot be changed)

     

3. the php. ini configuration item command is case sensitive, for example, file_uploads = 1 cannot be written as File_uploads = 1

II. case-insensitive 1. the function name, method name, and class name are case-insensitive. However, we recommend that you use the same name as the name when defining 2. the magic constant is case-insensitive. it is recommended that you use uppercase letters: __line _, _ FILE _, _ DIR _, _ FUNCTION _, _ CLASS _, _ METHOD _, and _ NAMESPACE __.

     

3. NULL, TRUE, and FALSE are case-insensitive. the following uses the php function var_dump.

     

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.