Prepare your apps to PHP7, which is soon to become the “current” version.

One of the problems might be the usage of preg_replace() function with “/e” modifiers. You might get this error message:

Deprecated function: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead

The solution is, as suggested, the preg_replace_callback() function. Here is one example:

$pattern = “my_pattern”;

$new_str = preg_replace(“/($pattern)/e”, “‘$1′”, $new_str);

will become

$new_str = preg_replace_callback(“/($pattern)/”, function($matches){return  $matches[0];},$new_str);

 

 

 

 

Move applications to PHP7

Leave a Reply

Your email address will not be published. Required fields are marked *