PHP case sensitive rules [reprinted]

Source: Internet
Author: User

PHP is not case sensitive. We recommend that you always stick to "Case sensitivity ". Note that classes and functions are case-insensitive. However, even if you are negligent, the interpreter will catch this error during debugging.

I. Case sensitivity 1. Variable names are case sensitive

All variables are case sensitive, including common variables and $ _ Get, $ _ post, $ _ Request, $ _ cookie, $ _ session, $ globals, $ _ server, $ _ files, $ _ ENV, etc;

2. Constant names are case-sensitive by default and are generally written in uppercase.

 

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, but the same name as the definition is recommended 2. The magic constant is case insensitive and it is recommended to use uppercase letters.

Including: __line _, _ file _, _ DIR _, _ function _, _ class _, _ method _, and _ namespace __.

3. null, true, and false are case-insensitive. 4. Type forced conversion, case-insensitive.

Including

  • (INT), (integer)-convert to integer
  • (Bool), (Boolean)-convert to boolean
  • (Float), (double), (real)-convert to floating point type
  • (String)-convert to string
  • (Array)-convert to an array
  • (Object)-convert to object

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.