Title: PHP 7 Compatibility
Last modified: December 20, 2016

---

# PHP 7 Compatibility

 *  Resolved [Justin McGuire](https://wordpress.org/support/users/vijustin/)
 * (@vijustin)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/php-7-compatibility-101/)
 * This plugin has a couple of PHP 7 issues, do you have a timeline for making your
   plugin PHP 7 compatible?
 * FILE: /nas/content/live/meekerdevcorp/wp-content/plugins/gravity-forms-constant-
   contact/api/cc_class.php
    ————————————————————————————————————- FOUND 2 ERRORS
   AFFECTING 1 LINE ————————————————————————————————————- 82 | ERROR | Extension‘
   ereg’ is deprecated since PHP 5.3 and removed since PHP 7.0 – use pcre instead.
   82 | ERROR | Function eregi() is deprecated since PHP 5.3 and removed since PHP
   7.0; use preg_match instead ————————————————————————————————————-
 * FILE: /nas/content/live/meekerdevcorp/wp-content/plugins/gravity-forms-constant-
   contact/constantcontact.php
    ———————————————————————————————————– FOUND 0 ERRORS
   AND 1 WARNING AFFECTING 1 LINE ———————————————————————————————————– 1295 | WARNING
   | Use of deprecated PHP4 style class constructor is not supported since PHP 7.———————————————————————————————————–

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

 *  [bcwd](https://wordpress.org/support/users/bcwd/)
 * (@bcwd)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/php-7-compatibility-101/#post-8636364)
 * I may be wrong, but I am testing this (line 81-83 – /wp-content/plugins/gravity-
   forms-constant-contact/api/cc_class.php) :
 *     ```
               protected function isValidEmail($email){
                    return preg_match("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i", $email);
               }
       ```
   
 *  [Tomatillo Design](https://wordpress.org/support/users/tomatillo/)
 * (@tomatillo)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/php-7-compatibility-101/#post-8647475)
 * Just wanted to follow up on the question of PHP7 compatibility…? Thanks!
 *  [greghollowell](https://wordpress.org/support/users/greghollowell/)
 * (@greghollowell)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/php-7-compatibility-101/#post-8665199)
 * Hi there,
    Same question, same errors and warning as vijuston found using the
   WP Engine PHP Compatibility Checker. I’d love to keep using your plugin if possible.
   Thank you.
 *  [greghollowell](https://wordpress.org/support/users/greghollowell/)
 * (@greghollowell)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/php-7-compatibility-101/#post-8666194)
 * In the meantime…
    To make this version PHP7 Compatible, change line 82 of plugins/
   gravity-forms-constant-contact/api/cc_class.php from: return eregi(“^[_a-z0-9-]
   +(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$”, $email); to: return
   preg_match(“^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})
   $”, $email);
 *  [bcwd](https://wordpress.org/support/users/bcwd/)
 * (@bcwd)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/php-7-compatibility-101/#post-8676413)
 * you missed the /i switch, so your example is case sensitive greg.
 * eregi is preg match with /i – though it seems like regex would be a more modern
   way.
 *  [viastudio](https://wordpress.org/support/users/viastudio/)
 * (@viastudio)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/php-7-compatibility-101/#post-8708345)
 * From what I can tell, the function that contains the offending code – isValidEmail–
   is never actually used anywhere within the plugin.
 *  Plugin Contributor [Zack Katz](https://wordpress.org/support/users/katzwebdesign/)
 * (@katzwebdesign)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/php-7-compatibility-101/#post-8823749)
 * Yes, isValidEmail isn’t used in the code. Version 3.0 should be PHP 7+ compatible.
 *  [WraithKenny](https://wordpress.org/support/users/wraithkenny/)
 * (@wraithkenny)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/php-7-compatibility-101/#post-8840680)
 *     ```
       FILE: /nas/content/live/meekerdevcorp/wp-content/plugins/gravity-forms-constant-contact/api/cc_class.php
       ————————————————————————————————————-
       FOUND 2 ERRORS AFFECTING 1 LINE
       ————————————————————————————————————-
       82 | ERROR | Extension ‘ereg’ is deprecated since PHP 5.3 and removed since PHP 7.0 – use pcre instead.
       82 | ERROR | Function eregi() is deprecated since PHP 5.3 and removed since PHP 7.0; use preg_match instead
       ```
   
 * is still an issue in 3.0
 *  [WraithKenny](https://wordpress.org/support/users/wraithkenny/)
 * (@wraithkenny)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/php-7-compatibility-101/#post-8840695)
 * Oh, if the function isn’t used, it’s a false-positive. OK!

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

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

 * ![](https://ps.w.org/gravity-forms-constant-contact/assets/icon-256x256.png?rev
   =1599317)
 * [Gravity Forms Constant Contact](https://wordpress.org/plugins/gravity-forms-constant-contact/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gravity-forms-constant-contact/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gravity-forms-constant-contact/)
 * [Active Topics](https://wordpress.org/support/plugin/gravity-forms-constant-contact/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gravity-forms-constant-contact/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gravity-forms-constant-contact/reviews/)

## Tags

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

 * 9 replies
 * 7 participants
 * Last reply from: [WraithKenny](https://wordpress.org/support/users/wraithkenny/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/php-7-compatibility-101/#post-8840695)
 * Status: resolved