重新定义 PHP 方法,可以调用旧方法
我有 method1() 对象;
例如,如何将 method1 移动到 method1_origin() 并创建具有附加功能和调用 method1_origin() 的可能性的新 method1?
我认为反思会有所帮助,但我不知道如何。
I have object with method1();
How can I move method1 for example to method1_origin() and create new method1 with additional functionality and possibility to call method1_origin()?
I think reflection can help, but I don't know how.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以调用 parent 函数。
You can call a parent function.
基本的 OOP,您可以在这里找到一些好的信息: http://php.net/manual/ en/语言.oop5.php
Basic OOP, you can find some good info here: http://php.net/manual/en/language.oop5.php
你需要延长一堂课
-
You need to extend a class
-