那些php遗忘的地方

自 5.4 起可以使用短数组定义语法,用 [] 替代 array()。

$secondElement = getArray()[1];
unset() 函数允许删除数组中的某个键。但要注意数组将不会重建索引。如果需要删除后重建索引,可以用 array_values() 函数。

$GLOBALS

静态变量

function test()
{
    static $a = 0;
    echo $a;
    $a++;
}
test();
test();
test();
test();

$a ** $b power

php 运算符