Take the State of PHP 2026 Survey →

Always available hash extension View as Markdown

Implemented (PHP 7.4)
Authors
Kalle Sommer Nielsen, kalle@php.net
Date
2018-09-04
Version
1.0
Source
wiki.php.net/rfc/permanent_hash_ext

Vote

Make the hash extension always available as described in this RFC? closed
Yes
30
No
0
30 voters
ab Yes 2018-09-22 18:02
ashnazg Yes 2018-09-19 14:02
bate Yes 2018-10-01 07:33
bwoebi Yes 2018-09-19 21:34
carusogabriel Yes 2018-09-20 13:32
cmb Yes 2018-09-19 15:41
derick Yes 2018-09-19 14:21
emir Yes 2018-09-24 04:41
galvao Yes 2018-09-20 12:29
hywan Yes 2018-09-25 10:48
jhdxr Yes 2018-09-19 16:54
jmikola Yes 2018-09-19 15:22
jwage Yes 2018-09-19 15:05
kalle Yes 2018-09-19 11:53
kguest Yes 2018-09-24 13:26
malukenho Yes 2018-09-21 09:40
mariano Yes 2018-09-21 21:19
mfonda Yes 2018-09-25 16:05
narf Yes 2018-09-19 11:58
nikic Yes 2018-09-28 18:55
ocramius Yes 2018-09-19 14:28
petk Yes 2018-09-20 00:14
pollita Yes 2018-09-19 13:54
remi Yes 2018-09-19 12:39
salathe Yes 2018-09-20 12:34
sammyk Yes 2018-09-19 15:35
sebastian Yes 2018-09-19 14:44
trowski Yes 2018-09-23 06:24
yunosh Yes 2018-09-20 07:49
zimt Yes 2018-09-27 12:27

Discussions on the mailing list

RFC Proposal: Make the hash extension always available
by Kalle Sommer Nielsen · 4 messages
RFC Vote: Make the hash extension always available
by Kalle Sommer Nielsen · 1 message

RFC text

Copied from wiki.php.net, last synchronized Oct 13, 2026 11:51 UTC

Introduction

This RFC proposes to make the hash extension (`ext/hash`) always available, similar to the `date`, `spl` & `pcre` extensions.

Proposal

The hash extension provides a very rich utility with many hashing algorithms which is extremely useful in modern day applications, not only in userland code but also very much in internals.

After a recent discussion on Github[1], Johannes proposed that the hash extension should be treated as special extension which cannot be disabled.

Backward Incompatible Changes

Build configurations that contain `--enable-hash` will have to be updated, as the argument will cease to exists. The `--with-mhash` argument will continue to stay.

Proposed PHP Version(s)

Target PHP version is the next master, which at the time of writing is most likely 7.4.

RFC Impact

To SAPIs and Existing Extensions

The only impact on SAPIs, Extensions and PECL extensions is that they can now always rely on the `hash` extension to be available and utilize its API without having external dependencies for such.

This naturally also means that minimal builds of PHP will slightly grow in size.

Unaffected PHP Functionality

Any already existing userland code will continue to work as before. Userland may remove calls to `extension_loaded('hash')` as they will now always return true.

The hash extension does not have any external dependencies, so this will not add any more dependencies for a minimal build of PHP.

Proposed Voting Choices

Since this touches a major component in the php-src source, the voting will require a 2/3 majority to pass.

Vote

As this is a language change, a 2/3 majority is required.

Vote: Make the hash extension always available as described in this RFC? — Yes: 30 · No: 0 (closed)

Patches and Tests

References