Re: Naming conventions
| From: | Mike Erickson | Date: | Thu, 25 May 2000 04:15:14 +0000 |
| Subject: | Re: Naming conventions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-503@lists.php.net to get a copy of this message | ||
On Wed, 24 May 2000, Matthew Kendall wrote:
> Are there any established standard naming conventions for variables,
> classes, etc., in PHP programs? If so, can someone point me to a
> description. Things that I want to get right first time include:
>
> filenames - .php or .php3 for scripts? .php or .inc for included scripts?
> variable names - myvar, myVar, MyVar, my_var? capitalisation, word
> separators, whether to distinguish between locals and globals, notionally
> public and private class members, functions and variables, etc.
> class names - ditto
.php for sure, as php3 is now going to be phased out, leaving the
extension a misnomer. .inc should be used carefully, for these files
aren't protected in the same way as .php files (in apache atleast) unless
you manually configure it to do so.
Here is what I've typically seen as the standard naming convention for
variables: $CONSTANT, $GlobalValue and $localvar.
/me
--
Mike Erickson <merickson@fix.net>
Network Operations, The FIX Network, Inc.
"Worldwide Technology - Hometown Service & Support" (sm)