我有這個小腳本量身定做的,我不能讓這個錯誤:惱人的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) –