Bug 540647 - better detection of heredoc and nowdoc marker names
Summary: better detection of heredoc and nowdoc marker names
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Thierry BLIND CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-31 06:17 EDT by Thierry BLIND CLA
Modified: 2020-05-14 13:20 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thierry BLIND CLA 2018-10-31 06:17:49 EDT
Hi,
the php parsers are not strict enough when looking for heredoc or nowdoc opening/closing markers. A closing marker should (of course) have same name than the opening marker, for example:
<?php
$a = <<< AAAA
test
AAAA;

but PDT "only" checks that the closing marker name is a suffix of the opening marker name. For example, following code is seen a valid heredoc (but shouldn't):
<?php
$a = <<< AAAA
test
BAAAA;

A more visible problem:
<?php
$a = <<< AAAA
BAAAA;
AAAA;

"BAAAA;" will not be inside the heredoc section and "AAAA;" will not mark the end of the heredoc.

Thierry.
Comment 1 Eclipse Genie CLA 2018-10-31 07:00:40 EDT
New Gerrit change created: https://git.eclipse.org/r/131735
Comment 3 Thierry BLIND CLA 2018-10-31 07:39:29 EDT
Fixed.
Comment 4 Eclipse Genie CLA 2018-10-31 10:17:25 EDT
New Gerrit change created: https://git.eclipse.org/r/131750