Title: Deprecated function &#8220;create_function&#8221; in PHP 7
Last modified: April 12, 2019

---

# Deprecated function “create_function” in PHP 7

 *  [steckinsights](https://wordpress.org/support/users/steckinsights/)
 * (@steckinsights)
 * [7 years ago](https://wordpress.org/support/topic/deprecated-function-create_function-in-php-7/)
 * Seeing errors when upgrading to PHP 7.2+.
 * > Deprecated: Function create_function() is deprecated in /wp-content/plugins/
   > wp-posts-carousel/carousel-widget.class.php on line 382
 * Looks like you need to adjust the function to be as follows on line 382 of carousel-
   widget.class.php:
 *     ```
       function yourmodifier_register_widgets() {
       	register_widget( 'WpPostsCarouselWidget' );
       }
       add_action( 'widgets_init', 'yourmodifier_register_widgets' );
       ```
   
 * The function you used is anonymous and it really should have a name, as described
   above, so the plugin can be extended and so it complies with PHP 7+.
 * Let us know if you do that, because we’d love to use your plugin instead of our
   edited version.

The topic ‘Deprecated function “create_function” in PHP 7’ is closed to new replies.

 * ![](https://ps.w.org/wp-posts-carousel/assets/icon-128x128.png?rev=1154352)
 * [WP Posts Carousel](https://wordpress.org/plugins/wp-posts-carousel/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-posts-carousel/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-posts-carousel/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-posts-carousel/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-posts-carousel/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-posts-carousel/reviews/)

## Tags

 * [deprecated function](https://wordpress.org/support/topic-tag/deprecated-function/)
 * [PHP7](https://wordpress.org/support/topic-tag/php7/)

 * 0 replies
 * 1 participant
 * Last reply from: [steckinsights](https://wordpress.org/support/users/steckinsights/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/deprecated-function-create_function-in-php-7/)
 * Status: not resolved