The "Blue" Comments...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lightnb
Forum Newbie
Posts: 13
Joined: Mon Jul 28, 2008 11:13 pm

The "Blue" Comments...

Post by lightnb »

I fell kind of stupid asking this, but:

What's the deal with the "Blue" comments, that begin with /** ?

In my editor, when you add the extra asterisk to a comment, all of the code in the comment turns blue instead of the normal grey. Does this do something special? There's no mention of this in the comments section of the PHP manual and searching for '/**' returns no results...
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: The "Blue" Comments...

Post by califdon »

That's because it has nothing to do with PHP, but everything to do with what editor you are using, which you didn't tell us.
lightnb
Forum Newbie
Posts: 13
Joined: Mon Jul 28, 2008 11:13 pm

Re: The "Blue" Comments...

Post by lightnb »

The actual color-coding is based on the editor, yes. BUT- The editor wouldn't make /** a different color than all other comments, unless /** has some special meaning to PHP.

One asterisk is gray, three or more is gray. Two, however, is special, and I'd like to know why, and what it signifies.
User avatar
markusn00b
Forum Contributor
Posts: 298
Joined: Sat Oct 20, 2007 2:16 pm
Location: York, England

Re: The "Blue" Comments...

Post by markusn00b »

lightnb wrote:The actual color-coding is based on the editor, yes. BUT- The editor wouldn't make /** a different color than all other comments, unless /** has some special meaning to PHP.

One asterisk is gray, three or more is gray. Two, however, is special, and I'd like to know why, and what it signifies.
No comments in PHP have a .. 'difference' .. really.

/* Allows you to have a multi-line comment. So:
/*
Comment
on
new lines
*/

While '//' and '#' just support single comments.

Your IDE will just simply have different styles for different comment syntax.
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: The "Blue" Comments...

Post by jayshields »

It's probably because your editor colour codes JavaDoc style comments differently to normal comments even though you're not coding in Java. Most editors do this.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: The "Blue" Comments...

Post by s.dot »

the phpdoc syntax /** */ is a token that is parsed in the php lexical analyzer (php >= 5), so maybe it's signaling a token.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply