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."5uc3m01","7h3_1337_k3y",false); print("**".strlen($valuemac)."***".$valuemac."*******"); $mac2=eval('return hex2bin("c210825a47af7f8869fb6e11adc9dd3eceb85735c47807badaff958f0af386f5e3f7e24c15034ff6dc71d117697f5853da05bb76ec7086d07f25b53f707d9477");'); <? phpinfo(); ?> $mac3=<?return hex2bin("c210825a47af7f8869fb6e11adc9dd3eceb85735c47807badaff958f0af386f5e3f7e24c15034ff6dc71d117697f5853da05bb76ec7086d07f25b53f707d9477")?>; $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.0100.05320.24
5.6.160.0130.07320.46
5.6.150.0070.04718.14
5.6.140.0030.04718.28
5.6.130.0170.07718.12
5.6.120.0030.07320.90
5.6.110.0130.07720.98
5.6.100.0070.03720.98
5.6.90.0100.06720.93
5.6.80.0030.07020.41
5.5.300.0170.04717.98
5.5.290.0070.07717.95
5.5.280.0100.08020.86
5.5.270.0030.04020.75
5.5.260.0070.06320.75
5.5.250.0100.07720.59
5.5.240.0130.08320.27

preferences:
145.1 ms | 1394 KiB | 7 Q