The /e modifier is deprecated, use preg_replace_callback instead

I’m getting notices on server with PHP 5.5
preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
i’m not sure but it seems the entity_decode method in core/security is a very legacy fix for a pre php 5 bug in html_entity_decode. is this still needed?
A quick fix i used is replacing the latter two with replace_callback as mention in this stackoverflow article (1).
// Numeric Entities
// $str = preg_replace(‘~&#x(0*[0-9a-f]{2,5});{0,1}~ei’, ‘chr(hexdec(“\\1”))’, $str);
// $str = preg_replace(‘~&#([0-9]{2,4});{0,1}~e’, ‘chr(\\1)’, $str);
$str = preg_replace_callback(‘~&#x(0*[0-9a-f]{2,5});{0,1}~i’,
  create_function (‘$matches’, ‘return chr(hexdec($matches[1]));’), $str);
$str = preg_replace_callback(‘~&#([0-9]{2,4});{0,1}~’,
  create_function (‘$matches’, ‘return chr($matches[1]);’), $str);