Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Events on PHP. Is it possible?

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.

like image 307
Jhonny D. Cano -Leftware- Avatar asked Jan 22 '23 14:01

Jhonny D. Cano -Leftware-


1 Answers

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

like image 165
Patrick Desjardins Avatar answered Jan 31 '23 15:01

Patrick Desjardins