Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

Solved: Preg_replace(): The /e modifier is no longer supported



I just started using Testrail. One of my users reported an issue with emailing a report:

preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead

I found the line responsible. I was in Headers.php:

$encoded_value[$key] = preg_replace("/<([^>]+)>/e", $cb, $encoded_value[$key]);

I tried changing it but with now successes. Any help would be appreciated.


$encoded_value[$key] = preg_replace_callback("/<([^>]+)>/", function($match) { return $cb; }, $encoded_value[$key]);