PHP 5.5+ complex event processor