PHP 5.5+ event layer