【发布时间】:2015-11-02 21:22:25
【问题描述】:
这是我收到的一条错误消息:我想知道是否有人可以解释此错误的含义以及以下代码的解决方法。
错误信息:第 381 行只能通过引用传递变量(第 381 行是 $semester 行。)
<?php // Student Fee section
if ($user->isStudentFeeDue()):
$semester = array_shift(array_slice($courses, 0, 1))->getSemester();
$studentfee = new UserLocationBasedStudentFee($semester, $user);
$purchase->addItem($studentfee);
?>
<div style="border-top: 2px solid rgb(0, 0, 0); padding: 16px 6px;">
<label>
<?php echo $studentfee->getDescription(); ?>
(<?php echo money_format(CBV\MONEY_FORMAT_COMMON, $studentfee->getCost()); ?>)
</label>
</div>
<?php endif; ?>
【问题讨论】:
标签: php