3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function deriveSP800108HmacSHA256Key($length, $array, $string, $array2) { $n = $n2 = 1; $allocate = ''; // length = $length while ($n < $length) { $mac = hash_init('sha256', HASH_HMAC, $array); $allocate2 = pack("L", $n2); hash_update($mac, $allocate2); hash_update($mac, $string); hash_update($mac, pack("L", 0)); hash_update($mac, $array2); $allocate2 = pack("L", $n * 8); hash_update($mac, $allocate2); $final = hash_final($mac, true); $allocate .= $final; $n2++; } return unpack('C*', $allocate); } var_dump(deriveSP800108HmacSHA256Key(32, 'array', 'foo', 'array2'));
based on UBcSb
Output for 7.3.0beta1
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 31457312 bytes) in /in/GMnbh on line 20
Process exited with code 255.
Output for 5.5.0 - 7.3.0alpha1

Process exited with code 137.