Title: PHP 7.2 Compatibility
Last modified: December 10, 2017

---

# PHP 7.2 Compatibility

 *  Resolved [pepe](https://wordpress.org/support/users/pputzer/)
 * (@pputzer)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/php-7-2-compatibility-3/)
 * When running on PHP 7.2, Slimstat throws a deprecation warning due to the use
   of `create_function`. A quick look at the code would suggest that the use of 
   a dynamically created function is not really necessary.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Jason Crouse](https://wordpress.org/support/users/coolmann/)
 * (@coolmann)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/php-7-2-compatibility-3/#post-9771878)
 * Hi! We’re using what WordPress recommends in their codex:
 * [https://codex.wordpress.org/Widgets_API](https://codex.wordpress.org/Widgets_API)
 * We’ll change that code to avoid any compatibility issues.
 * Thank you for pointing this out.
 * Best,
    Jason
 *  Thread Starter [pepe](https://wordpress.org/support/users/pputzer/)
 * (@pputzer)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/php-7-2-compatibility-3/#post-9772039)
 * Thanks. The codex is pretty obsolete at this point (all current API documentation
   is maintained in the [Code Reference](https://developer.wordpress.org/reference/)).
   Dynamic functions were a thing back when procedural programming was the norm 
   and PHP namespaces weren’t there yet.
 * When you have a class, adding an extra (static) method does not pollute the global
   namespace, so there is no reason for the slower `eval`/`create_function` call.(
   Also, with PHP 5.3+, you could always use an anonymous function.)
 *  Plugin Contributor [Jason Crouse](https://wordpress.org/support/users/coolmann/)
 * (@coolmann)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/php-7-2-compatibility-3/#post-9772290)
 * True! We added a static method, as we want to keep our compatibility with PHP
   5.2. Unfortunately (!) many of our users still use that version of the language.
 * Best,
    Jason

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PHP 7.2 Compatibility’ is closed to new replies.

 * ![](https://ps.w.org/wp-slimstat/assets/icon.svg?rev=2832242)
 * [SlimStat Analytics](https://wordpress.org/plugins/wp-slimstat/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-slimstat/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-slimstat/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-slimstat/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-slimstat/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-slimstat/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Jason Crouse](https://wordpress.org/support/users/coolmann/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/php-7-2-compatibility-3/#post-9772290)
 * Status: resolved