//I 有这样的代码
class Docs{
public $docName;
public $files=array();
}
class Files{
public $fileName;
}
$doc=new Docs;
$doc->files[0]=new Files;
// I have intellisense in this level
$doc->
//but there is no intellisense in next level
$doc->files[0]->
我使用哪个 IDE?我已经测试了 Dreamweaver 和 zend Studio 。
由于 PHP 可以是鸭型的,因此如果不通过 PHPDoc 进行显式类型声明(如果 DreamWeaver 支持),或者如果流程足够清晰,则由 IDE 执行反射(如果属性是由使用标量类型提示的构造函数传递给对象的,等等),则无法确定对象属性的类型。
$doc->文件几乎可以包含任何内容,那么 IDE 可以做什么呢?
无论如何,我总是推荐PHPStorm作为PHP IDE。