PHP上的事件可能吗? [英] Events on PHP. Is it possible?

查看:149
本文介绍了PHP上的事件可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我来自C#世界,刚刚开始做一些PHP编码,所以我想知道是否可以在PHP上使用事件,或者计划在将来的版本中包含这个功能。如果您有一种模拟方式,与不同这个,这将是非常感谢,谢谢。

解决方案

没有类似C#的事件在PHP,但你可以实现观察者模式附加代表以通知。


I'm coming from the C# world and has just started doing a little PHP coding, so I was wondering if it is possible to use events on PHP, or if it is planned to include this feature in a future release. If you have a way to simulate it, different than this, it would be very appreciated, thanks.

解决方案

No event like C# in PHP but you can implement a Observer Pattern to attach delegate to be notified.

这篇关于PHP上的事件可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆