0

In OOP, what do call it when you do:

$o = new ClassInstance();

$o->someFunction($p);

For example, I would say I'm passing the parameter p to the function someFunction. Easy.

But how do you articulate the calling of a function in the class object, ClassInstance? You're not really passing the function someFunction to the object ClassInstance.... so would you say: "Call the someFunction function in the ClassInstance object?"

Thanks.

bfavaretto
  • 71,580
  • 16
  • 111
  • 150
Ricalsin
  • 950
  • 9
  • 28

1 Answers1

1

"Call method someFunction from object $o (which is an instance of class ClassInstance), passing $p as an argument.".

Rephrasing for clarity:

$instance = new ClassName();
$instance->someMethod($p);

"Call method someMethod from object $instance (which is an instance of class ClassName), passing $p as a parameter (or argument)".

bfavaretto
  • 71,580
  • 16
  • 111
  • 150