2011-07-30 15 views
1

最近の静的バインディングを使用しようとすると、このエラーが発生します。私はこのエラーについてGoogleで見つけることができるのは、人々は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(); } 

} 
+0

これは私のためにうまく動作します。エラーはどの行ですか?あなたは5.3を実行していることをどのように知っていますか? –

+0

私はそれを自分でインストールしたので... – Julie

+1

私のディレクトリの名前はPHP5.3.6ですが、phpinfo()を呼び出すとPHP 5.2と表示されます。 – Julie

答えて

1

静的:: ext_autorisees(問題がある)

+0

self :: ext_autorisees() – devtut

+0

いいえ、私はそれを拡張する他のクラスを持っています、そして、私は彼らのext_autorisees()がこの1つではなく呼ばれることを望みます... – Julie

関連する問題