【发布时间】:2011-10-16 09:26:57
【问题描述】:
我在尝试使用后期静态绑定时遇到此错误。我在谷歌上能找到关于这个错误的所有信息是人们没有 PHP5.3,但我有 5.3.6 版本。
有人可以帮帮我吗?
谢谢
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?
-
因为是我自己安装的...
-
好吧,奇怪的是,我的目录名为 PHP5.3.6 ,但是当我调用 phpinfo() 它告诉我 PHP 5.2 ...