参考中文:
https://github.com/pangee/Migrating-from-PHP5.6.x-to-PHP7.0.x/blob/master/Backward-incompatible-changes.md
其中最值得关注的是间接变量的使用,这在我们之前的代码中用得许多
PHP 7 throws an Array to string conversion error if you are accessing an object with a nested array using syntax like $object->$array['key']; I haven't researched the exact reason for this but the parser tries to convert the array to a string versus reading the array element. Wrapping the array in curly brackets (like $object->{$array['key']}) allows the parser to interpret this correctly.
参考地址:
https://www.digitalocean.com/company/blog/getting-ready-for-php-7/
上面的中文地址里,也有描述。
------------正 文 已 结 束, 感 谢 您 的 阅 读 (折雨的天空)--------------------
转载请注明本文标题和链接:《php7语法的改变》
发表评论