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

Error while parsing HEREDOC

VotersWatch issueWatchersLinkUpdate 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. mytest.png
          241 kB
          Los Vitaly
        2. heredoc1.png
          386 kB
          Los Vitaly
        3. heredoc.png
          394 kB
          Los Vitaly

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            junichi11 Junichi Yamamoto
            vitalykk1983 Los Vitaly
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

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

                Slack

                  Issue deployment