Title: PHP timeout in function username_list
Last modified: May 10, 2022

---

# PHP timeout in function username_list

 *  Resolved [cerice](https://wordpress.org/support/users/cerice/)
 * (@cerice)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/php-timeout-in-function-username_list/)
 * Hello,
 * In wordpress multisite with 15000 users the function username_list in Helpers.
   php make php timeout.
    I replace de script :
 *     ```
       return array_reduce($rul_userresults, function ($carry, $item) {
   
                   $carry[$item[0]] = $item[0];
   
                   return $carry;
               });
       ```
   
 * by :
 *     ```
       $out=array();
               foreach($rul_userresults as $i) {
                   $out[$i[0]]=$i[0];
               }
               return $out;
       ```
   
 * and it’s work fine, maybe the array_reduce is to heavy !!!

Viewing 1 replies (of 1 total)

 *  [Collins Agbonghama](https://wordpress.org/support/users/collizo4sky/)
 * (@collizo4sky)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/php-timeout-in-function-username_list/#post-15632081)
 * Thank you, [@cerice](https://wordpress.org/support/users/cerice/), for the code
   recommendation.
 * We are actually working on a more improved way where searches for users are done
   over Ajax.
 * Before that will go live, we will in the meantime implement your code in the 
   next update.

Viewing 1 replies (of 1 total)

The topic ‘PHP timeout in function username_list’ is closed to new replies.

 * ![](https://ps.w.org/peters-login-redirect/assets/icon-256x256.png?rev=2597671)
 * [LoginWP (Formerly Peter's Login Redirect)](https://wordpress.org/plugins/peters-login-redirect/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/peters-login-redirect/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/peters-login-redirect/)
 * [Active Topics](https://wordpress.org/support/plugin/peters-login-redirect/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/peters-login-redirect/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/peters-login-redirect/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Collins Agbonghama](https://wordpress.org/support/users/collizo4sky/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/php-timeout-in-function-username_list/#post-15632081)
 * Status: resolved