Home > Article > Backend Development > New features of PHP5.4: Array dereferencing support_PHP tutorial
A long-awaited feature is finally here, here we go~
Array dereferencing is a good thing. With Array dereferencing, the previous way of writing is no longer necessary:
List($name,) = explode(",", "Laruence, male");
?>
Instead:
$name = explode(",", "b, x")[0];
In addition, Array derefencing can also appear in the lvalue of a reassignment statement, which means that theoretically you can write like this:
explode(",", "test1, test2")[3] = "phper";