3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $good_mac = hex2bin("0b12ae50aa4be68973372730489521f8cf77972a73b0e8c86fde8d97eaa84f02"); $bad_mac = hex2bin("0b12ae5000000000000000000000000000000000000000000000000000000000"); $hmac_key = random_bytes(32); var_dump( hash_hmac('sha256', $good_mac, $hmac_key), hash_hmac('sha256', $bad_mac, $hmac_key), hash_hmac('sha256', $good_mac, $hmac_key) === hash_hmac('sha256', $bad_mac, $hmac_key) );
based on 17APC
Output for 7.2.0
string(64) "cff4f614a0f967db89769f55f0b8c3774d3f5c0692f6b70129eb2537cba20f38" string(64) "df691dbf3bcccc0dab65c0bfd7091241b7a4ea408fc09583420bef218023c76d" bool(false)
Output for 7.1.10
string(64) "977679c80cd77eb65963b6c67e2f8bffe107e19515dc47b2dc9b597737b566f1" string(64) "571176d2fc02d57294a52ddfd1d6fa8ed1ef9976c6bf6fa62faec0e10a26299c" bool(false)
Output for 7.1.7
string(64) "54b0f8ce695c6e246a64a2d5f77c493175a1ffd4241f72edc821b2710db8765a" string(64) "1d9e617c33fb9714ed4d1b2755cc9708731b9f89339b4d537c23603e94e5ed1b" bool(false)
Output for 7.1.6
string(64) "85202851063fc89b5a5ea9aa94c4cc983f758d15fd328404c15995a03183348e" string(64) "cc20f3e60c5d789c79cd2f26069a801d35c8542d822dd33570ca047ed5d30acb" bool(false)
Output for 7.1.5
string(64) "9615582dccd4ee8fd339435805b4f6b74c55ee3fdeb3c008e35e8032ce058f5f" string(64) "8a70c5415f80ee24a3e24671ce205575f7dd93609fb6f8aebf3fa2e3336b5f77" bool(false)
Output for 7.1.0
string(64) "57995ea2a528d24bb87ac16c7ef665dc16f8d6de4c193d79dc9e33f32122a0f6" string(64) "98add8ccd5a76ead1321dd1ba6b49d83b9159ade44bd1c7097ee769f760a876a" bool(false)
Output for 7.0.20
string(64) "7fb07a93750efa2d6e52ffc61d534df1161bccff5784fa9fa64cf72a5eaa99eb" string(64) "5c46e55ac055621d4df0e330baf4c801354c09ebb8084be98fd1721e3b5b2715" bool(false)
Output for 7.0.6
string(64) "f5361942427e026f96422224bfcf6837a64302183bb08ac623809f4c5d2c5b71" string(64) "90f6af0302b147e819935d00f96b1af91430e9521619d9f88a59f20a15573025" bool(false)
Output for 7.0.5
string(64) "8834ec0b6b75fe5c09987a02b6faffa6bdead85275c94b7828a3f01997f7263b" string(64) "d3cd570ba2af59a6ac2be93e458a32bec118f56b394fc952ed6aa66ed186a41d" bool(false)
Output for 7.0.4
string(64) "838fc439f1f0dd60f751b00c647d7e293fae5424dac0dacb18db8d591db02e31" string(64) "8a89f21a4ac26bf59b0a07230b3ed09a2eda0698c87f554ae76af5c519479ab6" bool(false)
Output for 7.0.3
string(64) "d73f2ab73c85b253437fbbd39cd3d84d63abf223c58fb194e59569826ae4ac2b" string(64) "2ff2399c012060945ddd8af3770cac4f957624dae4b965699e3799db4eb235bc" bool(false)
Output for 7.0.2
string(64) "aff63a3d946439af04e60853fc27ca074a4c500f82a59e85accd943cf55f133a" string(64) "6fcc616117946385df47d639611e748a19ccd7fc21eb5df5fd30e7a7c472162f" bool(false)
Output for 7.0.1
string(64) "04988ce7b904c1992bd8d600fda7a8764f98a4ab3b4548a41a7b2a155ccaf4b0" string(64) "e62e64b3ac96e488866473b5de5db1c1f1f38658952e543afdbd638af4e5cef4" bool(false)
Output for 7.0.0
string(64) "102240036bc7d8d8a2160d49b89679dff52d1cb653a93ff3bd1907e0cb93ecb5" string(64) "b115e77402b0a1dbba8f21418d3c67a0ebdbe55f91801183a8d427b23bb3a856" bool(false)
Output for 5.4.9 - 5.6.28
Fatal error: Call to undefined function random_bytes() in /in/n9qu8 on line 6
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Fatal error: Call to undefined function hex2bin() in /in/n9qu8 on line 3
Process exited with code 255.