如何解决此PHP错误"only variables should be passed by a reference"?



首先,我是PHP的新手,以前从未做过......零技能......但我有一个任务来解决我工作中的一些错误,但我不知道如何处理它。

我这里有错误

法典:

<?$this->box->begin('rdgrey rdopen',null,'tree')?>
<?$this->box->headbegin();?>
<span class="title"><?=lang('site_tree')?> </span>
<?$this->box->headend();?>
<?$this->box->contentbegin('');?>   
<?
function pr(&$list,$key,&$c){
echo '<ul class="tree">';
$l=count(@$list[$key]);
$i=0;
if($l)
foreach($list[$key] as $k=>$v){
$has = count(@$c->content->config['has'][$v['type']]);
echo '<li class="',($k==$l-1?'last ':''),(count(@$c->content->config['has'] 
[$v['type']])?'folder ':'file ' ),
(isset($list[$v['url']])?'open ':''),'type_',($v['type']),'"> 
<span onClick="tree_tog(this)"></span><a href="',site_url('panel/'. 
($has?'index':'edit').'/'.$v['lang'].'/'.$v['nid'],null,false),'">
',character_limiter($v['name'],40),'</a>';
if($v['type']!='root'&&isset($list[$v['url']]))
pr($list,$v['url'],$c);

echo '</li>';
}
//if($key)
//echo '<li class="last"><a href="" onClick="return tognode('',$key,'',this)">+</a></li>';
echo '</ul>';
}
$lang = isset($_GET['lang']) ? $_GET['lang'] : @$node['lang'];
pr($this->content->getTree(@$node['url'],$lang),'/',$this);
?>

<?$this->box->contentend();?>   
<?$this->box->end()?>

这一行有问题

pr($this->content->getTree(@$node['url'],$lang),'/',$this);

它说只有变量应该通过引用传递。

有人可以帮助我吗?我应该如何解决这个问题?

不可思议的帽子 你的回答确实是正确的。 我必须创建变量并设置此结果$tmp = $this->content->getTree(@$node['url'],$lang)

所有的功劳都归功于不可思议的帽子

相关内容

最新更新