Php 语法错误,意外的T_静态
尝试使用后期静态绑定时出现此错误。我在谷歌上能找到的关于这个错误的信息是,人们没有PHP5.3,但我有5.3.6版 有人能帮我吗 谢谢Php 语法错误,意外的T_静态,php,late-static-binding,Php,Late Static Binding,尝试使用后期静态绑定时出现此错误。我在谷歌上能找到的关于这个错误的信息是,人们没有PHP5.3,但我有5.3.6版 有人能帮我吗 谢谢 class Media { private $nom, $ext; public function ext_autorisees() { return array(); } public function __construct( $fichier, $thumb = false ) {
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(); }
}
static::ext\u autorises()有问题。static::ext\u autorises()有问题。这对我来说运行正常。错误在哪一行?你怎么知道你在运行5.3呢?因为我自己安装了它…好吧,奇怪的是,我的目录名为PHP5.3.6,但当我调用phpinfo()时,它告诉我PHP5.2…这对我来说运行得很好。错误在哪一行?你怎么知道你在运行5.3?因为我自己安装了它…好吧,奇怪的是,我的目录名为PHP5.3.6,但当我调用phpinfo()时,它告诉我PHP5.2…你可以使用self::ext_autorises()不,我有其他类扩展了这个类,我希望调用它们的ext_autorises(),而不是这个…你可以使用self::ext_autorises()不,我有另一个类扩展了这个类,我希望调用它们的ext_autorises(),而不是这个类。。。