[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

a a p

Posted on 2014-01-24
5
Medium Priority
?
151 Views
Last Modified: 2014-01-25
Without separate php.net links what is difference / similarly method arguments, class attributes and parameters
0
Comment
Question by:rgb192
  • 3
  • 2
5 Comments
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39807656
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
 

Author Comment

by:rgb192
ID: 39809242
okay I still do not understand 'parameters'

should I stop using this word

and ask for clarification whenever I hear/see word 'parameters'
0
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 39809263
These are equivalent statements and appropriate uses of argument and parameter.

function thing($argument1, $argument2)
function thing($parameter1, $parameter2)
0
 

Author Closing Comment

by:rgb192
ID: 39809299
I will avoid using the word parameter and instead use argument. Thanks
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39809307
You'll be fine with that terminology.  Thanks for the points! ~Ray
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses
Course of the Month20 days, 6 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question