Title: PHP 7 Compatibility &#8211; preg_replace
Last modified: March 8, 2017

---

# PHP 7 Compatibility – preg_replace

 *  Resolved [dylanfitzger](https://wordpress.org/support/users/dylanfitzger/)
 * (@dylanfitzger)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/php-7-compatibility-preg_replace/)
 * I receive the following error when trying to validate for PHP 7.
 * FILE: ../plugins/linkify-text/linkify-text.php
    ———————————————————————————————————————————-
   FOUND 2 ERRORS AFFECTING 2 LINES ———————————————————————————————————————————-
   336 | ERROR | preg_replace() – /e modifier is deprecated since PHP 5.5 and removed
   since PHP 7.0 377 | ERROR | preg_replace() – /e modifier is deprecated since 
   PHP 5.5 and removed since PHP 7.0 ———————————————————————————————————————————-

Viewing 1 replies (of 1 total)

 *  Plugin Author [Scott Reilly](https://wordpress.org/support/users/coffee2code/)
 * (@coffee2code)
 * WordPress & Plugin Developer
 * [9 years, 2 months ago](https://wordpress.org/support/topic/php-7-compatibility-preg_replace/#post-8896637)
 * Hi [@dylanfitzger](https://wordpress.org/support/users/dylanfitzger/),
 * Thanks for the report! However, I believe the issue being reported is actually
   a shortcoming of the script or tool doing the validation.
 * The plugin file does not use the /e modifier, only /i, /u, /S.
 * ):
 * `$text = preg_replace( "~{$regex}~{$preg_flags}", $new_text, $text, $limit );`
 * The code scanner is likely seeing the “e” in the variable `$preg_flags` (which
   appears in the position a modifier is expected for `preg_replace()`). But that’s
   simply a character in a variable.
 * What code scanner are you using?
 * I have not encountered compatibility warnings or errors while running the plugin
   under PHP7. (There are some warning that will be fixed in the newest version,
   but aren’t due to PHP7.)

Viewing 1 replies (of 1 total)

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

 * ![](https://s.w.org/plugins/geopattern-icon/linkify-text_0074a2.svg)
 * [Linkify Text](https://wordpress.org/plugins/linkify-text/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/linkify-text/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/linkify-text/)
 * [Active Topics](https://wordpress.org/support/plugin/linkify-text/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/linkify-text/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/linkify-text/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Scott Reilly](https://wordpress.org/support/users/coffee2code/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/php-7-compatibility-preg_replace/#post-8896637)
 * Status: resolved