RFC: Always available hash extension


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


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.


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

Make the hash extension always available as described in this RFC?
Real name Yes No
ab (ab)  
ashnazg (ashnazg)  
bate (bate)  
bwoebi (bwoebi)  
carusogabriel (carusogabriel)  
cmb (cmb)  
derick (derick)  
emir (emir)  
galvao (galvao)  
hywan (hywan)  
jhdxr (jhdxr)  
jmikola (jmikola)  
jwage (jwage)  
kalle (kalle)  
kguest (kguest)  
malukenho (malukenho)  
mariano (mariano)  
mfonda (mfonda)  
narf (narf)  
nikic (nikic)  
ocramius (ocramius)  
petk (petk)  
pollita (pollita)  
remi (remi)  
salathe (salathe)  
sammyk (sammyk)  
sebastian (sebastian)  
trowski (trowski)  
yunosh (yunosh)  
zimt (zimt)  
Final result: 30 0
This poll has been closed.

Patches and Tests


rfc/permanent_hash_ext.txt · Last modified: 2018/11/22 19:17 by cmb