我有:
$myarr['DB'] = new DB(); $myarr['config'] = new config();
您可以提前定义数组键,然后PHPStorm会建议它们(CTRL空间)
$my = array(); $my['qwe'] = ''; $my['asd'] = ''; $my['zxc'] = ''; $my['']// inside '' will be autosuggest
你也可以使用PHPdoc(CTRL Q):
/** * keys: * <pre> * some_array (array) * some_bool (boolean) * some_double (double) * some_nice_integer (integer) * </pre> * @return array */ public function toArray(){ // return some array }