case insensitive in php

date: 2017-07-27

PHP的命名空间是否区分大小写?

结论:不区分大小写,与类名一样(不区分大小写)。

不区分大小写的包括

  1. 函数名
  2. 方法名
  3. 类名
  4. 控制语句(if, else, for, while, foreach)
  5. null,true, false
  6. 魔术变量
  7. 变量强制类型转换(int, string, double, boolean, object, array)
  8. 语言结构(echo, require, include)

相关阅读

  1. it is usually good form to call functions as they appear in their declaration.
  2. always use same cases when reference back to either variables(its' mandatory) or functions(its' optional, but recommended).

case sensitive

variables, constants, array keys, class properties, class constants

notice: array keys

Array
(
    [a] => bb
    [A] => CC
)

case insensitive

functions, class constructors, class methods, keywords and constructs (if, else, null, foreach, echo etc.)

原文地址:https://www.cnblogs.com/brookin/p/7247880.html