2013-01-24 72 views
0

我刚安装了xampp,运行一些旧的程序(创建2年或更多年前),我得到3我无法弄清楚的错误。php版本升级导致旧程序错误

  1. 严格的标准:只有变量应参考在C传递:\ XAMPP \ htdocs中\ 2010 \在线网\核心\路径\ route.php 117
public function loadClass($address,$ext='') { 
     $this->extname = preg_replace('/_/','/',$address,3); 
line:117>  $this->classname = end(explode('_',$address)).($e= $ext!='' ? '('.$ext.')' : ''); 
     include_once(ROOT_ROUTE.'/'.$this->extname.'.php'); 
     $this->newclass = new $this->classname; 
     return $this->newclass; 
    } 

行117我无法理解,它不是通过引用传递,为什么有一个错误?

+0

哪条线是在这种情况下,线117? – DWright

+0

$ this-> classname = end(explode('_',$ address))。($ e = $ ext!=''?'('。$ ext。')':''); – hkguile

+0

最终功能是什么样的? – DWright

回答

4

由于end()需要通过引用传递的参数,所以不能将其与非变量(如另一个函数调用或构造的直接结果)一起使用。

从参数定义报价在manual

这意味着你必须通过一个真正的变量,而不是一个函数返回一个数组,因为只有实际变量可以通过引用传递。

变化

$this->classname = end(explode('_',$address)).($e= $ext!='' ? '('.$ext.')' : ''); 

$addressTemp = explode('_',$address); 
$this->classname = end($addressTemp) . ($e= $ext!='' ? '('.$ext.')' : ''); 
+0

你是如此强大 – hkguile

相关问题