Let

let 语句用于可变变量、属性和数组。 变量默认是不可变的,并且该指令使它们在语句的作用域内是可变的:

  1. let name = "Tony"; // simple variable
  2. let this->name = "Tony"; // object property
  3. let data["name"] = "Tony"; // array index
  4. let self::_name = "Tony"; // static property

此指令也必须用于递增/递减变量:

  1. let number++; // increment simple variable
  2. let number--; // decrement simple variable
  3. let this->number++; // increment object property
  4. let this->number--; // decrement object property

可以在单个` let </ 0>操作中执行多个突变:</p>

  1. let price = 1.00, realPrice = price, status = false;
  2. `</pre>