<?php
$paragraph = "<p>With natural, refreshing scents and stimulating formulas, here you’ll find just what you need to experience a new level of comfort and luxury</p>";
var_dump(preg_replace('/<\/p>$/g', '<em>EMEMEMEMEMEM</em></p>', $paragraph));
Warning: preg_replace(): Unknown modifier 'g' in /in/se7kD on line 5
NULL
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Warning: preg_replace(): Unknown modifier 'g' in /in/se7kD on line 5
NULL
Output for 4.3.0 - 4.3.10
Warning: Unknown modifier 'g' in /in/se7kD on line 5
NULL