NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Minor syntax coloring issue
Veteran

Joined: 26 Dec 2006
Posts: 253
Location: Phoenix, AZ
Reply with quote
If you have a PHP keyword as a class member, references to it are colored as though they were used as keywords rather than as class members. For example:

$foo = $this->dirname;

Here, 'dirname' will be colored as a keyword.

I can't think of any other situations in which this occurs (such as $dirname or $foo['dirname']), so I believe it's just this one case.
View user's profileFind all posts by bobwilliamsSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
we're aware of this problem but it's hard to separate dirname standard function from such method call like in your example.
Indeed, the two files below are both correct:

fileA:
<?php
$foo = $this->
/* some comment */
dirname
/* some comment */
;

fileB:
<?php
/* some comment */
dirname
/* some comment */
('somepath');

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Veteran

Joined: 26 Dec 2006
Posts: 253
Location: Phoenix, AZ
Reply with quote
It seems like the IDE could identify your second example by the lack of the -> operator. As for your first example, I don't think I've ever seen that in any code I've looked at, and certainly not in any I've written - it's a maintenance disaster waiting to happen. I'd be happy enough if the IDE just required no whitespace (or only a single space) around ->. This may not be in strict alignment with what PHP supports, but it's in alignment with how most, perhaps nearly all, folks write code. At the very least, it would reduce the coloring issue to a single edge case. And FWIW, I can't get code insight to work with a line break in there, either, so it appears you already took such a position there.
View user's profileFind all posts by bobwilliamsSend private messageVisit poster's website
Minor syntax coloring issue
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic