If updated in the last few days then you need should clear the file cache. Also disabled event_guard_log_allowed until there is a setting to enable or disable it.
Update the source code
cd /var/www/fusionpbx
rm /var/cache/fusionpbx/*
service event_guard restart
- IN function block replace array with event to prevent a naming conflict.
- Reconnect to event socket if the connection is lost.
- Use condition if is_array around each foreach.
- Unset the database connection
- Use event socket variables and close the session before the loop