Event handling in PHP, without libevent