Home > Backend Development > PHP Tutorial > 简单有关问题,但是估计能答下的不多

简单有关问题,但是估计能答下的不多

WBOY
Release: 2016-06-13 13:01:35
Original
769 people have browsed it

简单问题,但是估计能答上的不多
情况A

<br />
return array_flip($result)[$parm];<br />
Copy after login


情况B
<br />
$result =  array_flip($result);<br />
return $result[$parm];<br />
Copy after login




编辑器都是 zend stuido 9 谁能解释下为什么有的编辑器不提示这个错误,有的编辑器提示这个错误
------解决方案--------------------
$result =  array_flip($result);
return $result[$parm];
这是传统的写法

return array_flip($result)[$parm];
这是php5.4新增的写法

不是编辑器是否报错,而是php是否报错!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template