Actually, it appears that mcrypt_generic_end() was deprecated in PHP 5.3, not PHP 5.4 (based on what ReflectionFunction::isDeprecated() reports in PHP 5.3, and also the documentation page for the function).
The following is a list of deprecated INI directives. Use of any of these INI
directives will cause an
E_DEPRECATED error to be thrown