PHP #region for code folding?

前端 未结 15 1458
星月不相逢
星月不相逢 2021-01-31 14:06

Is there an equivilent of c#\'s #region in PHP?

15条回答
  •  太阳男子
    2021-01-31 14:42

    No, there's nothing directly in the language.

    But every decent editors allow some kind of markup to allow this.

    For example in Netbeans :

    // 
      ...any code...
    // 
    

    This syntax also works in all the Intellij IDEA editor family, see http://blog.jetbrains.com/webide/2012/03/new-in-4-0-custom-code-folding-regions/

    You can also emulate the feature in Eclipse via a plugin : Code folding plugin for Eclipse?

    Visual Studio Code includes it since version 1.19 :

    #region user description
    ...any code...
    #endregion
    

提交回复
热议问题