3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mac($msg) { $key = "7h3_1337_k3y"; $nonce = "5uc3m01"; $bloc_size = 64; if(strlen($msg)==$bloc_size) { print("cas2"); $mac = $msg; } else if(strlen($msg)>$bloc_size) { print("cas3"); $mac = hash_hmac("sha512",$msg.$nonce,$key,true); } return crypt($mac,'$6$rounds=5000$OhMyG05h!'); } $lemessage="UNMESSAGEASSEZGRANDPOURTOMBERDANSLECASDUCALCULDEHASHMAPETPOUVOIRREJOURSONMACPOURTOMBERDANSLECASCRYPTODIRECT" $mac = mac($lemessage); $valuemac=hash_hmac("sha512",$lemessage.$nonce,$key,true); $mac2=eval('return hex2bin(\$valuemac);'); $b=mac($mac2); if($mac==$b) { print("OK"); } else{ print("KO"); } print($mac); print($b);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.0.00.0030.06320.15
5.6.160.0100.08020.46
5.6.150.0030.04318.28
5.6.140.0130.08318.15
5.6.130.0000.05318.28
5.6.120.0100.07020.98
5.6.110.0130.07321.02
5.6.100.0100.04320.98
5.6.90.0100.08321.05
5.6.80.0030.06720.49
5.5.300.0030.04017.99
5.5.290.0070.08317.97
5.5.280.0070.04320.68
5.5.270.0070.04020.79
5.5.260.0100.08020.64
5.5.250.0130.07020.58
5.5.240.0130.07020.16

preferences:
139.18 ms | 1394 KiB | 7 Q