Jump to content
Sign in to follow this  
terryds

@var, @param, @return meaning in php comment

Recommended Posts

I often see comments like

/*** The database class to store PDO objects** @var object*/

What does @var mean?

And, i often see @param, @return too... What do they mean?

 

I've ever seen strange comment like this one below. Can you tell me what it mean?

 

/*** $Id$*/
Edited by terryds

Share this post


Link to post
Share on other sites

As far as I know, that's not PHP syntax and, since it's in a comment, it won't do anything at all. I think it's a convention for developers to know what's in the code.

Share this post


Link to post
Share on other sites

it's probably a take on javadoc notation

http://www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html

http://en.wikipedia.org/wiki/Javadoc

Edited by thescientist
  • Like 1

Share this post


Link to post
Share on other sites

@Ingolme, @thescientistHave you two really not heard of phpDocumentor or are you being sarcastic :lol: ?

Share this post


Link to post
Share on other sites

No, I generally don't work with anything besides bare PHP.

Share this post


Link to post
Share on other sites

i haven't, but assumed it was, as I mentioned, a take on javadocs, which is exactly what phpdocs is.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×