This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 270107 - Variable in heredoc not noticed
Summary: Variable in heredoc not noticed
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Code (show other bugs)
Version: 8.2
Hardware: PC Windows 10
: P3 normal (vote)
Assignee: issues@php
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-17 10:06 UTC by jnm
Modified: 2017-03-17 10:06 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (92.59 KB, text/plain)
2017-03-17 10:06 UTC, jnm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jnm 2017-03-17 10:06:38 UTC
Product Version = NetBeans IDE 8.2 (Build 201609300101)
Operating System = Windows 10 version 10.0 running on amd64
Java; VM; Vendor = 1.8.0_66
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.66-b18

Reproducibility: Happens every time

STEPS:
The following PHP function

function foo() {
  echo <<<ENDOF
using "${M['Name']} "
ENDOF;
}

ACTUAL:
nothing happens

EXPECTED:
a hint saying $M not initialised within scope
(the code ought to have had $M as a global)

If the line was  just using $X as a simple variable, it does produce the hint.  It seems to be the use of { } curl;y brackets that triggers the issue.
Comment 1 jnm 2017-03-17 10:06:41 UTC
Created attachment 163875 [details]
IDE log