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

Error while parsing HEREDOC

Rank to TopRank to BottomVotersWatch issueWatchersConvert to sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

      Description

      Reproducible code:

      <?php 
      $code = <<<EOF
         if(!isset(\$routes[\$pathinfo])) {  // Syntax error unexpected: String  after: ]
              break;
        } 
      EOF;
      

      Same error in Laravel project in vendor directory. Full path
      /var/www/html/laravel/vendor/symfony/routing/Matcher/Dumper/PhpMatcherDumper.php
      And the same errors in Composer library

      $code .= <<<EOF
              default:
                  \$routes = array(
      {$this->indent($default, 4)}            );
      
      if (!isset(\$routes[\$pathinfo])) {   // Syntax error unexpected: String  after: ]
              break;
       }
      list(\$ret, \$requiredHost, \$requiredMethods, \$requiredSchemes) = \$routes[\$pathinfo];
      {$this->compileSwitchDefault(false, $matchHost)
              }
      EOF;
      

        Attachments

        1. heredoc.png
          394 kB
          Los Vitaly
        2. heredoc1.png
          386 kB
          Los Vitaly
        3. mytest.png
          241 kB
          Los Vitaly

          Activity

          $i18n.getText('security.level.explanation', $currentSelection) Viewable by All Users
          Cancel

            People

            • Assignee:
              junichi11 Junichi Yamamoto
              Reporter:
              vitalykk1983 Los Vitaly

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m

                  Issue deployment