# State of mhash?

- Thread: https://externals.io/message/107192
- Original archive: https://news-web.php.net/php.internals/107192
- Started by Nikita Popov on 2019-09-17T14:25:25+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #107192 — Nikita Popov — 2019-09-17T14:25:25+00:00

URL: https://externals.io/message/107192#107192

Hi,

I just noticed that the hash extension has a default-disabled --with-mhash
option, that enables a couple of additional mhash_* functions. From what I
was able to gather, mhash was an old extension that was superseded by hash,
and hash provides a compatibility layer for mhash.

Should these functions be deprecated? Should this compatibility layer be
kept indefinitely?

Regards,
Nikita

---

## #107201 — Christoph M. Becker — 2019-09-18T11:39:09+00:00

URL: https://externals.io/message/107192#107201 · In reply to: #107192

#
> I just noticed that the hash extension has a default-disabled --with-mhash
> option, that enables a couple of additional mhash_* functions. From what I
> was able to gather, mhash was an old extension that was superseded by hash,
> and hash provides a compatibility layer for mhash.
>
> Should these functions be deprecated? Should this compatibility layer be
> kept indefinitely?

The documentation[1] states for more than ten years now:

| This extension is obsoleted by Hash.

So I think actually deprecating these functions for PHP 8 is appropriate.

[1] <https://www.php.net/manual/en/intro.mhash.php>

--
Christoph M. Becker

---

## #107209 — Sara Golemon — 2019-09-18T15:17:50+00:00

URL: https://externals.io/message/107192#107209 · In reply to: #107201

On Wed, Sep 18, 2019 at 6:39 AM Christoph M. Becker <cmbecker69@gmx.de>
wrote:
>
> 
> > […]
>
> The documentation[1] states for more than ten years now:
>
> | This extension is obsoleted by Hash.
>
> So I think actually deprecating these functions for PHP 8 is appropriate.
>
Given that the mhash compatability shim is literally just "map this
function and args to that function and args", this one feels like a
no-brainer.  Anyone who can't upgrade because of /this/ change can
literally just drop a single (short) PHP script into their program to
polyfill those APIs.

It would be a kindness for someone to provide that, and if nobody else does
I may just drop a package on composer in the new few months.

+1

-Sara
