a a p

Without separate php.net links what is difference / similarly method arguments, class attributes and parameters
LVL 1
rgb192Asked:
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)
0
 
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.
0
 
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'
0
 
rgb192Author Commented:
I will avoid using the word parameter and instead use argument. Thanks
0
 
Ray PaseurCommented:
You'll be fine with that terminology.  Thanks for the points! ~Ray
0
All Courses

From novice to tech pro — start learning today.