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.3.1
string(64) "dae9d4322b0960abd48dfe030c13fa65cfe4e26438597f0f5325f33278e1aebb" string(64) "7a4e05df756a8583ab40f3525168ae2db30ebadf5a3998c53800d6380336c76f" bool(false)
Output for 7.3.0
string(64) "2c5bf2e547011c09e2fd85915a0e42b4d511db897ba986bb5d1f0688b0116b88" string(64) "855ed3954c6ed08b6d4fb89c41d9f468d3133964fe48bd81d559e67dda37fdcf" bool(false)
Output for 7.2.13
string(64) "107423edd550b318f83f9e2d6d2b04f0fd0b689b0f9f859441b85719ede33aae" string(64) "6b99c1046003b6caf6e8e8ced84a62c3ed5627239eac64557518daccf924569d" bool(false)
Output for 7.2.12
string(64) "9877cdd2354a133dc47d2b69d43e568e226d349ad5c23adc5d5c6cdabba6313f" string(64) "ca0d2191ab3a9e3f9136367f1e9b5f28603aa14156f6a7380f2fb575d9935e4d" bool(false)
Output for 7.2.11
string(64) "28634202df3fa6d52f158df7a1735290c50fe34fc614ace31f242ca6e53efbda" string(64) "a246a83fc11d3eabf7a6118bd6a14ef2a0e4f0be7881cf7604f75020ce5bb57a" bool(false)
Output for 7.2.10
string(64) "c0334a8ab5a34576fe712624ea6eadf00e4dd35014e6e5c6d739662b4858acd5" string(64) "9dee7c4e7c7cd401715694d808b04ce4c3f698800de8cc72122af1ef090bdd85" bool(false)
Output for 7.2.9
string(64) "3e496c614f50298fa3c966f5e1b9b4f970afc0e2e6b36360bef06dd1f1e01b7c" string(64) "850c79b89f6184c4dbb1fb237e261ef1d463327429a4f98cc6c388d626a5f0e0" bool(false)
Output for 7.2.8
string(64) "738e3e6884d92adbba0137921f84c87032528b39c1b875c8636a3ae5aa17c3a4" string(64) "88805cb870c956cd4ad27aad4125bdd70ba8672592aad247a0b0bd5dc858b95d" bool(false)
Output for 7.2.7
string(64) "c31edb1ac91c92d1d6190c4909fd2085d6421b25d0fca12f2f66d6cafc02f5ef" string(64) "198c4de09c88d7c10bbf5ac4f38acd349b03b4e2a85313e7544767ffb2788ad9" bool(false)
Output for 7.2.6
string(64) "562198e75d8c39dff12d15f228ea38066df25ea776494276731aacc1dc378307" string(64) "f71547b74cd96667152e55f56994dd80544bab494d6188356c5f4631a6e5a1cf" bool(false)
Output for 7.2.5
string(64) "54d1d8786684af1ae7f3dfede0d58a6ddea49c5da00a9dafeae81ccecbab40a7" string(64) "c169d310a5da229830e4cb13f1a29a293ddcf7057624236579bb9834db8008fb" bool(false)
Output for 7.2.4
string(64) "d83cb67f8a6f4542206621408bb3db59bad74c36c5a25b0918205cf16191b6a4" string(64) "7a26ee3566a16619ee685cbab88d08314d5bce07590deaafadf7ed24ce5c95f7" bool(false)
Output for 7.2.3
string(64) "3e6d6ee03a87782454e6034e231ca3454611e70edc7fc57b6548e78fb825ac73" string(64) "ed9dfe7951eac8805886a2d3215fa36e655dd6ae24a29349899544032a90bb5e" bool(false)
Output for 7.2.2
string(64) "8610429eb70b6baabbc39c4c79b6d44f9245eae9641fda89ec03568f9f947305" string(64) "5142c7c646112ba6699c6080770badbf14882e21be9ec04545d2576a6fd882b7" bool(false)
Output for 7.2.1
string(64) "e1a05b03ee68d205c8a2b72e4d7a22b860c99e75726f51373c7da0569aa6f537" string(64) "6882586d24929d8bcf61672bf827e8056498dedaf648c686c897796053016cdf" bool(false)
Output for 7.2.0
string(64) "b336dd7044662dc850fd1d81eef803f4d033f42f7a88cbae23e22d03a365c2ae" string(64) "6199b95e7d4649684acf630269c33dc104486eb9f18b2fa97519ebb7b9c30e0d" bool(false)
Output for 7.1.25
string(64) "4d8342dada3a3637c3e6cca80286e7a97e6724b71a1a037e362ca666e2874d2c" string(64) "3c3dd412e0be5c49d6ca3e9c23649437c6e958379d61fc302ec442a8ba562adf" 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.