Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP PHP Basics Getting to Know PHP PHP Comments

Alexander Chamwada
Alexander Chamwada
1,844 Points

Tags in a docblock start with which character?

Is it this character "/"? Its not on the list

3 Answers

If you meant to say a "comment", there's three ways to do it in PHP. And yes, you can't just have one / to make a comment, you need two of them.

Here's an example:

// This is a comment

This is NOT a comment, in fact this line of code will create an error

# This is also a comment

/* This is the only kind of comment
that can span multiple lines! Cool! */

Do you get it now? I hope you do :)

Good luck! ~Alex

Glenré Charl Labuschagné
Glenré Charl Labuschagné
23,204 Points

Hi, Alexander, the key word here is Tags.

Tags are a type of specialized information (meta-data) about the associated element and always starts on a new line with an at-sign (@) followed by the name of the tag.

https://phpdoc.org/docs/latest/references/phpdoc/inline-tags/index.html

So the answer is the 'at sign (@)'.

Can you give me a "Best Answer" so that this question won't be in the "Unanswered Questions" section of the community? Thank you very much! :)

I appreciate it.