php如何添加引用

发布于 2024-12-04 06:06:01 字数 149 浏览 1 评论 0原文

我想问如何在php中转换:method(Class1::Class2 &class);? 我应该写什么:me->method(????)

hx.感谢

我在 c__/ubuntu 工作。

i would like to ask how to convert: method(Class1::Class2 &class); in php?
what should i write: me->method(????)

hx. appreciate

I am working in c__/ubuntu.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

掩饰不了的爱 2024-12-11 06:06:01

同样的方式:

function method(&$variable)

但是,如果 &class 是一个对象,则没有必要 - 从 PHP 5 开始,对象会自动作为引用传递。 本身就是一种引用,所以这不是必需的。

The same way:

function method(&$variable)

However, if &class is an object, it's not necessary - since PHP 5, objects are automatically passed as reference. a kind of references in themselves, so this isn't necessary.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文