我试图使用晚期静态绑定时出现此错误。所有我可以在谷歌找到关于这个错误的是,人们没有PHP5.3,但我有版本5.3.6。语法错误,意外T_STATIC
有人可以帮我吗?
感谢
class Media
{
private $nom,
$ext;
public function ext_autorisees() { return array(); }
public function __construct($fichier, $thumb = false)
{
$fichier = explode(".", $fichier);
$nom = $fichier[0];
$ext = $fichier[1];
if(in_array(strtoupper($ext), static::ext_autorisees()))
{
if(strpos($nom, "thumb_") === 0 && !$thumb)
throw new Exception("");
}
else
throw new Exception("");
$this->nom = $nom;
$this->ext = $ext;
}
public function getNom() { return $this->nom; }
public function getExt() { return $this->ext; }
public function getPath() { return $this->getNom() . "." . $this->getExt(); }
public function getThumb() { return "thumb_" . $this->getPath(); }
}
这将运行对我蛮好。什么是错误?你怎么知道你正在运行5.3? –
因为我自己安装它... – Julie
好吧,好奇地,我的目录名为PHP5.3.6,但是当我打电话phpinfo()它告诉我PHP 5.2 ... – Julie