I find camelCase a little more pleasant to type, because I find the underscore a bit awkward to type.
Don't use global variables.
I avoid procedural coding in PHP, I find OOP is easier to keep things organized. Besides, doesn't PHP have enough stuff in it's global namespace already?
Generally I try to stick to:
- Classes are StudlyCaps singular or plural nouns, as appropriate:
Item
, Row
, DB
, Items
.
- Variables are lowercase nouns, singular or plural depending on what they hold:
$column
, $name
- Constants are singular upper-case nouns:
DEBUG
, TYPE_FOO
.
- Methods are camelCase, and begin with singular verbs (
get
, perform
, do
), followed by a noun (singular or plural) describing what it operates on or returns (getThing()
, getThings()
)
It definitely depends on what you're coding for. If I'm coding PHP or PEAR, I use camelCase. If I'm doing Python/Django, I use under_scores. If I'm writing ELisp, I use dashed-separators.