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 191930 - Variable does not seem to be used in this scope - method call
Summary: Variable does not seem to be used in this scope - method call
Status: RESOLVED DUPLICATE of bug 170541
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P4 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-14 09:43 UTC by Nox
Modified: 2011-09-13 08:03 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nox 2010-11-14 09:43:48 UTC
Example:

$where /* warning here */ = $variable ? "orWhere" : "andWhere";

if( something )
  $query->$where( somethingelse );

All updates installed yesterday
Comment 1 OndrejBrejla 2011-02-14 14:17:44 UTC
I'm not sure if I can reproduce exactly your problem. If you mean, that there is a warning yellow line under the $where variable, so that's bad.

But what I only see is yellow line under the $variable and $query. And that's right. Neither $variable nor $query is initialized. If you write:

$variable = null;

before that snippet, there is no yellow line under the $variable.

So I think that it's feature, not bug or defect.
Comment 2 Nox 2011-02-14 18:06:41 UTC
Yes, I meant $where. '... not been initialized' is an unintended imperfection of the snippet.

This is easily reproducable by copy/pasting the snippet as I belive it is (in case of $where) independent code.

The main thing is that $where in the ...->$where(... is not detected as the $where's use in the scope. Iirc there are few other situations with imperfect 'usage in scope' detection, but I can't remember off the top of my head right now.

Of course - it's just P4 thing
Comment 3 Tomas Mysik 2011-06-08 14:57:49 UTC
Batch reassigning.
Comment 4 Ondrej Brejla 2011-09-13 08:03:54 UTC

*** This bug has been marked as a duplicate of bug 170541 ***