3v4l.org

run code in 300+ PHP versions simultaneously
<?php $users = array( array( 'id' => 1, 'first_name' => 'Peter', 'last_name' => 'Griffin', ), array( 'id' => 14, 'first_name' => 'Ben', 'last_name' => 'Smith', ), array( 'id' => 3, 'first_name' => 'Joe', 'last_name' => 'Doe', ) ); $ids = array_column($users, 'id'); //add_action('um_before_profile_fields', 'trigger_new_notification', 100); // Not sure what this does function trigger_new_notification( $args , $ids ) { global $um_notifications; /*$vars = array( "post_title" => get_post_field( 'post_title', $project_id ), "photo" => um_get_avatar_url( get_avatar( get_current_user_id(), 40 ) ), "member" => um_user('display_name'), "notification_uri" => cpm_url_project_details( $project_id ) );*/ foreach($ids as $row){ //$um_notifications->api->store_notification( $row, 'new_action', $vars ); echo $row . " "; } } //do_action( 'um_before_profile_fields'); // what does this do? // Dont know what $args is suppsed to be, just made a dummy. $args = ["something", "else"]; // Here I call the function and pass $args and $ids. trigger_new_notification( $args , $ids );
Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
1 14 3

preferences:
114.23 ms | 1435 KiB | 4 Q