0
function foo($bar,$barbar,$option="") {}

Is there a proper term for $bar etc., and/or name for optional variables?

Mechanical snail
  • 28,373
  • 14
  • 86
  • 111
aslum
  • 11,271
  • 15
  • 46
  • 68

1 Answers1

1

In that example, $bar is a parameter. Given your example, in a call of foo(1, 2, 3); the value 1 would be an argument. See this question for the distinction. (tl;dr version: parameters are the slots/variables that hold the arguments.)

$option is an optional parameter.

Community
  • 1
  • 1
cdhowie
  • 144,362
  • 22
  • 272
  • 285
  • Thanks! This is exactly what I was looking for. I knew this, or at least learned it long ago and forgot it. – aslum Jul 20 '11 at 23:09