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.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
1 14 3
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 1 14 3

preferences:
157.15 ms | 402 KiB | 170 Q