a a p

Without separate php.net links what is difference / similarly method arguments, class attributes and parameters
Who is Participating?
Ray PaseurConnect With a Mentor Commented:
These are equivalent statements and appropriate uses of argument and parameter.

function thing($argument1, $argument2)
function thing($parameter1, $parameter2)
Ray PaseurCommented:
Method arguments are the variables that are passed to the methods (functions) of a class.  Example here, where $x is an argument to the Thing constructor

Class Thing
    public function __construct($x) { ...

Class member variables are called "properties". You may also see them referred to using other terms such as "attributes" or "fields", but for the purposes of the PHP reference we call them "properties".

Parameters is another term often used for function or method arguments.  There is some overlap in the terminology.
rgb192Author Commented:
okay I still do not understand 'parameters'

should I stop using this word

and ask for clarification whenever I hear/see word 'parameters'
rgb192Author Commented:
I will avoid using the word parameter and instead use argument. Thanks
Ray PaseurCommented:
You'll be fine with that terminology.  Thanks for the points! ~Ray
All Courses

From novice to tech pro — start learning today.