My hosting provider recently forced me to move from PHP 5.6 to PHP 7.1. This broke a LaTeX plugin on my other blog, because the plugin’s PHP code contained a deprecated ‘/e’ modifier in two preg_replace function calls. This deprecated modifier was completeley removed in PHP 7, and caused the whole plugin to not work anymore.

The fix was to go to the plugin editor and just remove the /e flags in the two preg_replace calls. The two old lines:

$text= preg_replace('/&#(\d+);/me',"chr(\\1)",$text); #decimal notation
 
$text= preg_replace('/&#x([a-f0-9]+);/mei',"chr(0x\\1)",$text);  #hex notation

Replace them with these lines:

$text= preg_replace('/&#(\d+);/m',"chr(\\1)",$text); #decimal notation
 
$text= preg_replace('/&#x([a-f0-9]+);/mi',"chr(0x\\1)",$text);  #hex notation

Additionally, I had to empty the cache in my “WP Super Cache” plugin, since that plugin had cached the faulty formulas.