1--TEST-- 2Crypto\Hash::getAlgorithms basic usage. 3--FILE-- 4<?php 5$algorithms_all = Crypto\Hash::getAlgorithms(); 6if (is_array($algorithms_all) && !empty($algorithms_all)) 7 echo "ALL\n"; 8$algorithms_aliases = Crypto\Hash::getAlgorithms(true); 9if (is_array($algorithms_aliases) && !empty($algorithms_aliases)) 10 echo "ALIASES\n"; 11$algorithms_sha = Crypto\Hash::getAlgorithms(false, 'SHA'); 12// print all SHA algorithms except SHA as it's not in OpenSSL 1.1 13foreach ($algorithms_sha as $algorithm_sha) { 14 if ($algorithm_sha !== 'SHA') { 15 echo $algorithm_sha . "\n"; 16 } 17} 18 19?> 20--EXPECT-- 21ALL 22ALIASES 23SHA1 24SHA224 25SHA256 26SHA384 27SHA512 28