Fatal error: Can't use function return value in write context
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Fatal error: Can't use function return value in write context相关的知识,希望对你有一定的参考价值。
这个的出错原因很简单,先贴出错代码:
1 <?php 2 $contact = array("id"=>1, "姓名"=>"老高", "公司"=>"A公司", "地址"=>"北京"); 3 $list($key, $value) = each($contact); 4 echo "$key => $value"; 5 ?>
解决:经检查,原来是第三行list函数前加了个$符,去掉即可,贴上正确代码:
1 <?php 2 $contact = array("id"=>1, "姓名"=>"老高", "公司"=>"A公司", "地址"=>"北京"); 3 list($key, $value) = each($contact); 4 echo "$key => $value"; 5 ?>
此外:网上遇到这个错误的人很多,类型也不同,但个人认为基本原因跟返回值类型出错
以上是关于Fatal error: Can't use function return value in write context的主要内容,如果未能解决你的问题,请参考以下文章
Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist(
Mysql报错Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't
Fatal error: Can't use function return value in write context
Fatal error: Can't use function return value in write context的问题
mysql安转过程中出现的问题! Fatal error: Can't open and lock privilege tables: Table 'mysql.user' d
mysql安转过程中出现的问题! Fatal error: Can't open and lock privilege tables: Table 'mysql.user' d