php resource centre

  • about
  • articles
  • tutorials
  • resources
  • certification
Home

Primary links

  • About
  • Articles
  • Tutorials
  • Resources
  • Certification

PHP Coding Standards - I

admin — Tue, 22/08/2006 - 3:32pm

Guidelines

Non-documentation comments are strongly encouraged. A general rule of thumb is that if you look at a section of code and think " Wow, I don't want to try and describe that " , you need to comment it before you forget how it works.




Guidelines

Non-documentation comments are strongly encouraged. A general rule of thumb is that if you look at a section of code and think " Wow, I don't want to try and describe that " , you need to comment it before you forget how it works.

  • C++ style comments (/* */) and standard C comments (//) are both acceptable.

  • Use of perl/shell style comments (#) is prohibited.

PHPdoc Tags

Inline documentation for classes should follow the PHPDoc convention, similar to Javadoc. More information about PHPDoc can be found here:

http://www.phpdoc.de/

File Comments:

Every file should start with a comment block describing its purpose, version, author and a copyright message. The comment block should be a block comment in standard JavaDoc format along with a CVS Id tag. While all JavaDoc tags are allowed, only the tags in the examples below will be parsed by PHPdoc.

GForge contains a mixed copyright. For files that have been changed since the GForge fork, the following header should be used:

/** * * brief description. * long description. more long description. * * Portions Copyright 1999-2001 (c) VA Linux Systems * The rest Copyright 2002 (c) their respective authors * * @version $Id: coding_standards.xml,v 1.1 2003/01/03 17:43:10 rspisser Exp $ * */

  • Tutorials
  • Login to post comments

User login

  • Request new password

Follow Us

Who's online

There are currently 0 users and 1 guest online.

Who's new

  • Nisha
  • linnaeus
  • Yameen
  • TalleyReedy
  • admin

Follow vipin7873 on Twitter

<!-- Start of Woopra Code -->

<!-- End of Woopra Code -->

  • about
  • articles
  • tutorials
  • resources
  • certification

copyright © 2010 Vipin Chandran