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');')"; $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.0130.05320.19
5.6.160.0170.07320.49
5.6.150.0170.07018.27
5.6.140.0100.04318.18
5.6.130.0030.07718.18
5.6.120.0100.07721.13
5.6.110.0070.08321.14
5.6.100.0070.03721.12
5.6.90.0000.04720.95
5.6.80.0100.08020.35
5.5.300.0100.07017.97
5.5.290.0030.06017.92
5.5.280.0170.07320.76
5.5.270.0030.04720.96
5.5.260.0130.07020.80
5.5.250.0070.08020.59
5.5.240.0170.07320.27

preferences:
140.52 ms | 1394 KiB | 7 Q