Home  >  Article  >  Backend Development  >  New features of PHP5.4: Array dereferencing support_PHP tutorial

New features of PHP5.4: Array dereferencing support_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:48:29845browse

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";

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478426.htmlTechArticleA long-awaited feature is finally available. In a twist~ Array dereferencing is a good thing, with Array dereferencing , the previous writing method is no longer necessary: ​​?php list($name,) =...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn