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.30, 8.2.0 - 8.2.26, 8.3.0 - 8.3.14, 8.4.1
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:
59.31 ms | 407 KiB | 5 Q