From e28959dc3b19578f6931201dbc0b455a89808ed8 Mon Sep 17 00:00:00 2001 From: Jonathan Ernst Date: Wed, 29 Dec 2004 03:38:37 +0000 Subject: [PATCH] added variable naming guidelines --- CODING_STANDARD | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CODING_STANDARD b/CODING_STANDARD index a811a43..6ca2ff6 100644 --- a/CODING_STANDARD +++ b/CODING_STANDARD @@ -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