added variable naming guidelines

This commit is contained in:
Jonathan Ernst
2004-12-29 03:38:37 +00:00
committed by WineHQ
parent 035750d787
commit e28959dc3b

View File

@@ -70,3 +70,28 @@ if(!isset($appId))
1) it is off by default in php 4.1+
2) it is more secure
3) it makes it easier to understand where your vars are comming from (forms, session, etc.)
- variables naming
variables that don't come from outside your script (i.e. that arent fetched from superglobals) should be named this way
(a.k.a hungariant notation):
prefix + var_name
Where prefix is one of:
Scalar types:
i for integers
f for floats
s for strings
b for booleans
Compound types:
a for arrays
o for objects
Special type:
h for handles
the rest of the variable's name is using camel style
examples:
$aUsers
$iTopicId
$hRecordSet
$sQuery
$hResult