dna*_*irl 4 php eclipse syntax-highlighting
我在PHP类中有以下静态函数:
static function __callStatic($method,$args){
$called=NULL;
if(empty(static::$collection)) static::slurp();
if(method_exists(static::$objtype,$method)){
foreach(static::$collection as $obj){
$called[]= call_user_func_array(array($obj, $method), $args);
}
} else if (property_exists(static::$objtype,$method)){ //$method isn't a method, it's a property
foreach(static::$collection as $obj){
$called[]= $obj->$method;
}
} else if($method=='collection'){
$called=static::$collection;
} else {
throw new ZException("$method does not exist");
}
return $called;
}
Run Code Online (Sandbox Code Playgroud)
静态变量都已定义但可能未设置.代码看起来像我想要的那样,并且不会抛出任何级别的错误.但是我的Eclipse(Helios)PDT的新安装已将每个实例标记static::$var为"意外的静态"错误.如果我更换static::$var与self::$varEclipse的错误去离开-但随后的代码不起作用.
我如何说服Eclipse这些不是错误?
Eclipse for PHP Developers版本:Helios Service Release 1在64位CentOS上构建id:20100917-0705
PHP 5.3引入了Late Static Binding.检查Window> Preferences> PHP> Executables and Interpreter以确保Eclipse使用PHP 5.3.

| 归档时间: |
|
| 查看次数: |
492 次 |
| 最近记录: |