Title: create_function removed in PHP 8.0 (2nd)
Last modified: October 6, 2022

---

# create_function removed in PHP 8.0 (2nd)

 *  [Matthieu](https://wordpress.org/support/users/theschappy/)
 * (@theschappy)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/create_function-removed-in-php-8-0-2nd/)
 * Hi there,
 * in response to [https://wordpress.org/support/topic/create_function-removed-in-php-8-0/](https://wordpress.org/support/topic/create_function-removed-in-php-8-0/)
   which was already closed for replies.
 * If you upgrade to php8 you might encounter a problem when enabling the plugin
   because PHP’s `create_function` method is no longer support. Here is a quick 
   fix:
 *     ```
       --- search-everything.org.php   2022-10-06 12:21:25.734307941 +0200
       +++ search-everything.php       2022-10-06 12:32:49.297463110 +0200
       @@ -233,7 +233,11 @@
                                       $search_terms = array( $s );
                               } else {
                                       preg_match_all( '/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches );
       -                               $search_terms = array_filter(array_map( create_function( '$a', 'return trim($a, "\\"\'\\n\\r ");' ), $matches[0] ));
       +                               $func = function ($a) {
       +                                       return trim($a, "\\\"\'\\n\\r ");
       +                               };
       +                               $search_terms = array_filter(array_map( $func, $matches[0] ));
                               }
                       }
       ```
   
 * Cheers!
    -  This topic was modified 3 years, 8 months ago by [Matthieu](https://wordpress.org/support/users/theschappy/).

Viewing 1 replies (of 1 total)

 *  [amaroak](https://wordpress.org/support/users/amaroak/)
 * (@amaroak)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/create_function-removed-in-php-8-0-2nd/#post-16393259)
 * [@theschappy](https://wordpress.org/support/users/theschappy/) Thank you so much
   man,
 * I came to check if someone had had the same problem and you already had it solved,
   thank you very much!

Viewing 1 replies (of 1 total)

The topic ‘create_function removed in PHP 8.0 (2nd)’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/search-everything_242529.svg)
 * [Search Everything](https://wordpress.org/plugins/search-everything/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/search-everything/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/search-everything/)
 * [Active Topics](https://wordpress.org/support/plugin/search-everything/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/search-everything/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/search-everything/reviews/)

## Tags

 * [create_function](https://wordpress.org/support/topic-tag/create_function/)

 * 1 reply
 * 2 participants
 * Last reply from: [amaroak](https://wordpress.org/support/users/amaroak/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/create_function-removed-in-php-8-0-2nd/#post-16393259)
 * Status: not resolved