]> granicus.if.org Git - php/commitdiff
Describe the standards for function naming and private methods.
authorJon Parise <jon@php.net>
Tue, 17 Jul 2001 23:55:10 +0000 (23:55 +0000)
committerJon Parise <jon@php.net>
Tue, 17 Jul 2001 23:55:10 +0000 (23:55 +0000)
pear/CODING_STANDARDS

index cd48d1546b56f921274bfac6ac9b13acdf363631..852b49c70e020769267bcc8a98d86aae0a4e8eb6 100644 (file)
@@ -123,6 +123,18 @@ function connect(&$dsn, $persistent = false)
     return true;
 }
 
+Functions should be named using the "studly caps" style (also referred to as
+"bumpy case" or "camel caps".  The initial letter of the name is lowercase,
+and each letter that starts a new "word" is capitalized.  Some examples:
+
+    connect()       getData()       buildSomeWidget()
+
+Private methods (meaning methods that an intented to be called only from
+within the same class; PHP does not yet support truly-enforceable private
+namespaces) are preceeded by a single underscore.  For example:
+
+    _sort()         _initTree()     _validateInput()
+
 
 ------------
 [5] Comments