Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-5604

Heredoc syntax: Invalid closing identifier not shown by Netbeans

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • php - Editor
    • None

    Description

      See here:

      https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc

      Warning
      It is very important to note that the line with the closing identifier must contain no other characters, except a semicolon (. That means especially that the identifier may not be indented.

      Netbeans ignore this completely.

      Closing "EOT;" must always be on the left, no indentation

      Invalid:

      <?php
      class foo {
          public $bar = <<<EOT
      bar
          EOT;
      }
      // Identifier must not be indented
      ?>
      

      Valid:

      <?php
      class foo {
          public $bar = <<<EOT
      bar
      EOT;
      }
      ?>
      

      (Example from official php doc)

       

      Attachments

        Activity

          People

            junichi11 Junichi Yamamoto
            FFT Jayce
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: