Solved

a a p

Posted on 2014-01-24
5
140 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 108

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 108

Accepted Solution

by:
Ray Paseur earned 500 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 108

Expert Comment

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now