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

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

Mechanical snail
  • 29,755
  • 14
  • 88
  • 113
aslum
  • 11,774
  • 16
  • 49
  • 70

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
  • 158,093
  • 24
  • 286
  • 300
  • 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