3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dumb_hash(string $arbitrary, bool $raw_binary = false): string { $h = sodium_crypto_shorthash($arbitrary, 'SoatokDreamseekr'); if ($raw_binary) { return $h; } return sodium_bin2hex($h); } var_dump( dumb_hash('Stormi the Folf'), dumb_hash('Diffuse Moose') );
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.32, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
string(16) "ea95f49e869c11d6" string(16) "37851cdaf9f5d7db"
Output for 7.4.33
Fatal error: Uncaught Error: Call to undefined function sodium_crypto_shorthash() in /in/SMnki:5 Stack trace: #0 /in/SMnki(13): dumb_hash('Stormi the Folf') #1 {main} thrown in /in/SMnki on line 5
Process exited with code 255.

preferences:
158.55 ms | 401 KiB | 187 Q