Support for event-driven programming in PHP classes