Title: PHP 7 Compatibility Warning
Last modified: April 4, 2018

---

# PHP 7 Compatibility Warning

 *  Resolved [model13](https://wordpress.org/support/users/model13/)
 * (@model13)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/php-7-compatibility-warning-2/)
 * Hi, we’re preparing to update to PHP 7, and I’m running preliminary checks of
   our code using the PHP Compatibility Checker plugin. wpDirAuth is throwing one
   warning when tested with PHP 7.2. The details are below:
 * FILE: [path redacted]/wp-content/plugins/wpdirauth/wpDirAuth.php
    ———————————————————————–
   FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ———————————————————————– 2190 |
   WARNING | Function create_function() is deprecated since PHP 7.2; Use an anonymous
   function instead ———————————————————————–
    -  This topic was modified 8 years, 2 months ago by [model13](https://wordpress.org/support/users/model13/).

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

 *  Plugin Author [Paul Gilzow](https://wordpress.org/support/users/gilzow/)
 * (@gilzow)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/php-7-compatibility-warning-2/#post-10146239)
 * I use it on PHP7 currently. What’s being flagged is the bit I added for compatibility
   with older PHP versions (since WordPress refuses to update their min requirements
   for PHP).
 *     ```
                * Added this back in to support older versions of PHP (*cough*5.2.X*cough*)
                * @todo remove completely once we hit v2.X.X
                */
               if(version_compare( PHP_VERSION, '5.3', '<' )){
                   add_action('lostpassword_form',create_function('','echo get_site_option("dirAuthChangePassMsg");'));
               } else {
                   add_action('lostpassword_form',function ()
                   {
                       echo get_site_option('dirAuthChangePassMsg');
                   });
               }
       ```
   
 * There shouldn’t be any issues with running on PHP7.2.
 *  Thread Starter [model13](https://wordpress.org/support/users/model13/)
 * (@model13)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/php-7-compatibility-warning-2/#post-10147340)
 * Thank you! I appreciate the info. I’ve encountered this with a couple of other
   plugins as well. As much as I’d like to dissect them all myself, we’re running
   too many installations (including several multisites) to cover all the bases 
   at short notice.
 *  Plugin Author [Paul Gilzow](https://wordpress.org/support/users/gilzow/)
 * (@gilzow)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/php-7-compatibility-warning-2/#post-10147514)
 * no worries. I’d really like to drop support for old versions as it is becoming
   increasingly difficult to support both 5.2 **AND** 7.2. 🙁

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

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

 * ![](https://s.w.org/plugins/geopattern-icon/wpdirauth.svg)
 * [wpDirAuth](https://wordpress.org/plugins/wpdirauth/)
 * [Support Threads](https://wordpress.org/support/plugin/wpdirauth/)
 * [Active Topics](https://wordpress.org/support/plugin/wpdirauth/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpdirauth/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpdirauth/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Paul Gilzow](https://wordpress.org/support/users/gilzow/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/php-7-compatibility-warning-2/#post-10147514)
 * Status: resolved