runEvent('user_registered', $new_user_data);
if ($condition) { runEvent('custom_event', $data); }In this example, the 'custom_event' is triggered only if the condition is met, and the $data variable is passed as an argument. The runEvent function is not part of the standard PHP library, and is likely to be found in a package or library that implements event-driven programming in PHP. Some examples of event-driven programming packages for PHP include ReactPHP, Symfony EventDispatcher, and PhergieEventManager.