OPP 命名问题:object->function($param)
在 OOP 中,当你这样做时,该怎么称呼它:
$o = new ClassInstance();
$o->someFunction($p);
例如,我会说我将参数 p 传递给函数 someFunction。简单的。
但是如何清楚调用类对象 ClassInstance 中的函数呢?您并没有真正将函数 someFunction 传递给对象 ClassInstance...所以您会说:“在 ClassInstance 对象中调用 someFunction 函数吗?”
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“从对象
$o
(它是类ClassInstance
的实例)调用方法someFunction
,将$p
传递为一个论点。”为了清楚起见,重新表述一下:
“从对象
$instance
(它是类ClassName
的实例)调用方法someMethod
,传递$p< /code> 作为参数(或参数)”。
"Call method
someFunction
from object$o
(which is an instance of classClassInstance
), passing$p
as an argument.".Rephrasing for clarity:
"Call method
someMethod
from object$instance
(which is an instance of classClassName
), passing$p
as a parameter (or argument)".