PHP5.4新特性之Array dereferencing support
一个盼望已久的特性,终于有了,转之~Array dereferencing是个好东西, 有了Array dereferencing, 以前的这种写法就再也不必要了:
<?php
list($name,) = explode(",", "Laruence, male");
?>
取而代之的是:
$name = explode(",", "b, x")[0];
另外, Array derefencing也可以出现再赋值语句的左值中, 也就是理论上你可以这么写:
explode(",", "test1, test2")[3] = "phper";
补充:Web开发 , php ,