【问题标题】:Fatal error: Unsupported operand types at cpvlap stats致命错误:cpvlap stats 中不支持的操作数类型
【发布时间】:2016-02-19 06:30:46
【问题描述】:
我在错误统计文件中发现了这个错误
Fatal error: Unsupported operand types in /home1/bestdail/public_html/cpvlap/cpv_lab_install_files/stats.php on line 338
这是第 338 行
$totalsRow[0] += $columnsForTotals[$j] = $reportLines[$i][$columnsForTotals[$j]];
【问题讨论】:
标签:
javascript
java
c#
arrays
performance
【解决方案1】:
在您提到的这一行中,您必须分配不正确的作业:
$totalsRow[0] += $columnsForTotals[$j] = $reportLines[$i][$columnsForTotals[$j]];
你会注意到你是这么说的:
$totalsRow[0] = $totalsRow[0] + $columnsForTotals[$j] = $reportLines[$i][$columnsForTotals[$j]];
这是什么引发了你的错误,所以你需要找出你到底想在这一行做什么,并且只有一个作业。所以修复那条线,我认为你应该没问题。另请记住,由于我们不知道这些变量是什么,因此请确保 $columnsForTotals[$j]] 返回一个 int,因为您将它用作数组的索引。