Title: PHP 7 create_function deprecated
Last modified: February 15, 2019

---

# PHP 7 create_function deprecated

 *  [bkjproductions](https://wordpress.org/support/users/bkjproductions/)
 * (@bkjproductions)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/php-7-create_function-deprecated/)
 * If you’re using PHP7.x you may get an error of **create_function deprecated**
 * Somewhere around line 196 of **datetimepicker.php**
 * `create_function('$var', 'return ! empty($var);')` is the problem.
    Change that
   line to `function($var) {return ! empty($var);}`
 * So that section around line 194 reads:
 *     ```
       private function options_encode() {
       		$options = json_encode(array_filter(
       			$this->options,
       			function($var) {return ! empty($var);}
       		));
       		return stripslashes($options);
       	}
       ```
   

Viewing 1 replies (of 1 total)

 *  [skye20](https://wordpress.org/support/users/skye20/)
 * (@skye20)
 * [7 years ago](https://wordpress.org/support/topic/php-7-create_function-deprecated/#post-11483569)
 * Thanks!

Viewing 1 replies (of 1 total)

The topic ‘PHP 7 create_function deprecated’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/contact-form-7-datepicker.svg)
 * [Contact Form 7 Datepicker](https://wordpress.org/plugins/contact-form-7-datepicker/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7-datepicker/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7-datepicker/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7-datepicker/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7-datepicker/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7-datepicker/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [skye20](https://wordpress.org/support/users/skye20/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/php-7-create_function-deprecated/#post-11483569)
 * Status: not resolved