我有这个小脚本量身定做的,我不能让这个错误:恼人的PHP错误:“严格的标准:只有变量应参考在传递”
Strict Standards: Only variables should be passed by reference in C:\xampp\htdocs\includes\class.IncludeFile.php on line 34" off!
这里是页:
namespace CustoMS;
if (!defined('BASE'))
{
exit;
}
class IncludeFile
{
private $file;
private $rule;
function __Construct($file)
{
$this->file = $file;
$ext = $this->Extention();
switch ($ext)
{
case 'js':
$this->rule = '<script type="text/javascript" src="'.$this->file.'"></script>';
break;
case 'css':
$this->rule = '<link type="text/css" rel="stylesheet" href="'.$this->file.'">';
break;
}
}
private function Extention()
{
return end(explode('.', $this->file));
}
function __Tostring()
{
return $this->rule;
}
}
请帮帮我。
哪一条是第34行? – Leri
您是否检查了第34行?你是否检查过关于第34行的任何文档?你知道参考文献的工作原理吗? – lanzz
[严格标准:只有变量应通过引用传递]的可能重复(http://stackoverflow.com/questions/2354609/strict-standards-only-variables-should-be-passed-by-reference) –