Title: Wrong error (preg_replace() &#8211; /e modifier is forbidden since PHP 7.0)
Last modified: October 12, 2016

---

# Wrong error (preg_replace() – /e modifier is forbidden since PHP 7.0)

 *  Resolved [codyarsenault](https://wordpress.org/support/users/codyarsenault/)
 * (@codyarsenault)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/wrong-error-preg_replace-e-modifier-is-forbidden-since-php-7-0/)
 * Hi there,
 * When running the PHP compatibility checker, we are receiving an error for the
   Cache Enabler plugin which says “1328 | ERROR | preg_replace() – /e modifier 
   is forbidden since PHP 7.0” however this seems to be a mistake as the line in
   question shows the following:
 *     ```
       $cleaned = preg_replace(
         array(
           '/<!--[^\[><](.*?)-->/s',
           '#(?ix)(?>[^\S ]\s*|\s{2,})(?=(?:(?:[^<]++|<(?!/?(?:textarea|pre)\b))*+)(?:<(?>textarea|pre)\b|\z))#'
         ),
         array(
           '',
           ' '
         ),
         $data
       );
       ```
   
 * which works fine in PHP7 and does not use the /e modifier.
 * Can you please take a look?
 * Thanks!

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

 *  Plugin Contributor [Jason Stallings](https://wordpress.org/support/users/octalmage/)
 * (@octalmage)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/wrong-error-preg_replace-e-modifier-is-forbidden-since-php-7-0/#post-8284529)
 * Hi [@codyarsenault](https://wordpress.org/support/users/codyarsenault/),
 * There’s an open PR to resolve this:
 * [https://github.com/wimg/PHPCompatibility/pull/266](https://github.com/wimg/PHPCompatibility/pull/266)
 * Just waiting for it to get merged.
 *  Plugin Contributor [Jason Stallings](https://wordpress.org/support/users/octalmage/)
 * (@octalmage)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/wrong-error-preg_replace-e-modifier-is-forbidden-since-php-7-0/#post-8368629)
 * This should be resolved! Please let us know if you need anything else.
 *  [Saša](https://wordpress.org/support/users/stodorovic/)
 * (@stodorovic)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/wrong-error-preg_replace-e-modifier-is-forbidden-since-php-7-0/#post-8425745)
 * Hi [@octalmage](https://wordpress.org/support/users/octalmage/),
 * I just found similar issue in the latest Avada (5.0.3):
 * `$this->value = preg_replace( $this->field['preg']['pattern'], $this->field['
   preg']['replacement'], $this->value );`
 * `30 | ERROR | preg_replace() - /e modifier is deprecated since PHP 5.5 and removed
   since PHP 7.0`
 *  [Juliette Reinders Folmer](https://wordpress.org/support/users/jrf/)
 * (@jrf)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/wrong-error-preg_replace-e-modifier-is-forbidden-since-php-7-0/#post-8550258)
 * The above referenced PR fixed a different issue. There is now a new PR which 
   should correctly fix the two different issues mentioned in this thread.
 * [https://github.com/wimg/PHPCompatibility/pull/300](https://github.com/wimg/PHPCompatibility/pull/300)

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

The topic ‘Wrong error (preg_replace() – /e modifier is forbidden since PHP 7.0)’
is closed to new replies.

 * ![](https://ps.w.org/php-compatibility-checker/assets/icon-256x256.png?rev=1446087)
 * [PHP Compatibility Checker](https://wordpress.org/plugins/php-compatibility-checker/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/php-compatibility-checker/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/php-compatibility-checker/)
 * [Active Topics](https://wordpress.org/support/plugin/php-compatibility-checker/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/php-compatibility-checker/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/php-compatibility-checker/reviews/)

## Tags

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

 * 4 replies
 * 4 participants
 * Last reply from: [Juliette Reinders Folmer](https://wordpress.org/support/users/jrf/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/wrong-error-preg_replace-e-modifier-is-forbidden-since-php-7-0/#post-8550258)
 * Status: resolved