Difference between parameters and arguments - are they the same?

Many programmers use the terms 'parameters' and 'arguments' interchangeably. Consider the following function -

function best_function_ever( int $param1, string $param2, bool $default = true ) 
In the above code, $param1, $param2 and $default are 'parameters'; or are they arguments? Most of the people would say there's no difference between them and they are correct. However, at times, you might be required to know the subtle difference between the terms parameters and arguments. So keep this in mind:
  • Parameters: These are the values that your function will accept, as designed.
  • Arguments: These are the actual values that you pass when calling the function.
An interviewer might just throw this googly at you during a technical interview to test your knowledge.

If you want more clarification or have doubts, post them below so that we can discuss.

Replies

You are reading an archived discussion.

Related Posts

i am going to perform a project on pneumatics (title is pneumatic vegetable cutter )and i need a source where i can find a better abstact for it
facebook add friend option not found? i sent friend request to a person.then after some time i just checked whether that person accepted the request or not? for that i...
Project Abstract / Summary : FLIGHT FINDER TILLNOW IT IS VERY HARD TO FIND A FLIGHT WHICH IS CRASHED OVER A OCEAN .BECAUSE THE DEPTH OF OCEAN IS VERY LARGE...
Leon Bellan and his team from the Vanderbilt University have artificially created full-scale organs from cotton candy machines. The mechanical engineering department is in the process of revolutionizing the printing...
Project Abstract / Summary : ● In current situation of rigorous working hours that eat up all our week, we are left with just the week end as a solace...