3v4l.org

run code in 300+ PHP versions simultaneously
<?php function padding($msg,$nb_chars) { $charset = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9'); for($cpt=0;$cpt<$nb_chars;$cpt++) { $rand = rand(0,61); print("!!!!!!!!!!!!!!!!!".$rand); $msg .= $charset[$rand]; } return $msg; } function mac($msg) { $key = "7h3_1337_k3y"; $nonce = "5uc3m01"; $bloc_size = 64; if(strlen($msg)<$bloc_size) { $msg = padding($msg,$bloc_size-strlen($msg)); $mac = $msg; } else if(strlen($msg)==$bloc_size) { $mac = $msg; } else if(strlen($msg)>$bloc_size) { $mac = hash_hmac("sha512",$msg.$nonce,$key,true); } return crypt($mac,'$6$rounds=5000$OhMyG05h!'); } $lemessage="UNMESSAGEASSEZLONGPOURTOMBERDANSLECASDUHASHMAPETREGENERERUNHASHAVECLEHASHDECETTEVALEUR"; $mac = mac($lemessage); $valuemac=hash_hmac("sha512","123456789012345678901234567890123456789012345678901234567890123455uc3m01","7h3_1337_k3y",false); print("**".strlen($valuemac)."***".$valuemac."*******"); $mac2=eval('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.4.10.0070.02914.93
7.4.00.0030.03314.93
7.3.130.0030.03315.11
7.3.120.0130.02314.89
7.3.110.0100.02714.81
7.3.100.0030.02215.13
7.3.90.0100.01915.03
7.3.80.0000.02414.77
7.3.70.0000.02514.76
7.3.60.0030.02015.05
7.3.50.0060.01814.90
7.3.40.0040.01914.90
7.3.30.0000.02415.03
7.3.20.0100.01316.91
7.3.10.0070.01716.67
7.3.00.0030.01616.49
7.2.260.0070.02914.85
7.2.250.0030.03215.11
7.2.240.0070.01714.69
7.2.230.0060.01915.00
7.2.220.0030.02014.75
7.2.210.0070.02615.16
7.2.200.0030.01615.19
7.2.190.0100.01915.12
7.2.180.0030.02314.96
7.2.170.0040.02115.16
7.2.160.0070.01815.10
7.2.150.0040.01717.06
7.2.140.0130.01716.89
7.2.130.0060.01916.92
7.2.120.0000.02617.03
7.2.110.0000.02717.06
7.2.100.0040.02116.98
7.2.90.0030.02416.77
7.2.80.0070.02017.05
7.2.70.0130.01617.01
7.2.60.0100.02817.00
7.2.50.0100.02817.08
7.2.40.0070.01716.75
7.2.30.0030.02316.78
7.2.20.0070.01716.94
7.2.10.0100.01717.00
7.2.00.0030.02218.10
7.1.330.0090.01315.54
7.1.320.0030.02615.93
7.1.310.0030.02015.86
7.1.300.0070.02015.68
7.1.290.0030.01715.93
7.1.280.0000.02215.78
7.1.270.0030.02015.80
7.1.260.0040.02215.65
7.1.250.0030.02015.86
7.1.240.0000.02115.94
7.1.230.0000.02515.95
7.1.220.0030.02115.68
7.1.210.0030.02415.70
7.1.200.0030.02215.84
7.1.190.0070.02916.03
7.1.180.0070.02815.78
7.1.170.0030.02115.95
7.1.160.0030.02115.82
7.1.150.0000.03615.93
7.1.140.0070.02015.88
7.1.130.0030.02515.75
7.1.120.0100.01715.73
7.1.110.0070.02315.97
7.1.100.0050.01816.99
7.1.90.0060.01915.75
7.1.80.0030.02415.91
7.1.70.0020.02616.61
7.1.60.0080.02917.50
7.1.50.0050.02816.49
7.1.40.0030.02115.48
7.1.30.0040.02215.63
7.1.20.0040.02115.97
7.1.10.0100.01915.59
7.1.00.0080.05519.09
7.0.330.0030.01715.52
7.0.320.0100.01315.57
7.0.310.0100.01715.48
7.0.300.0030.02715.38
7.0.290.0040.02515.51
7.0.280.0030.02115.56
7.0.270.0030.01815.59
7.0.260.0060.02215.41
7.0.250.0070.02415.22
7.0.240.0120.01215.58
7.0.230.0060.01615.50
7.0.220.0100.01315.43
7.0.210.0060.01915.35
7.0.200.0030.02116.28
7.0.190.0070.01815.39
7.0.180.0030.02015.46
7.0.170.0060.01815.55
7.0.160.0030.02915.69
7.0.150.0040.01415.53
7.0.140.0040.02115.54
7.0.130.0040.01815.55
7.0.120.0030.01915.55
7.0.110.0000.02515.33
7.0.100.0090.01515.59
7.0.90.0060.01615.64
7.0.80.0070.02015.57
7.0.70.0030.02415.23
7.0.60.0050.05518.62
7.0.50.0080.03616.67
7.0.40.0130.02816.96
7.0.30.0150.05916.87
7.0.20.0150.05516.85
7.0.10.0030.06516.93
7.0.00.0050.03416.94
5.6.400.0060.01914.33
5.6.390.0090.01514.44
5.6.380.0100.02314.00
5.6.370.0030.03314.45
5.6.360.0070.02014.69
5.6.350.0070.02114.71
5.6.340.0060.02514.00
5.6.330.0030.02014.54
5.6.320.0080.01113.99
5.6.310.0070.02514.34
5.6.300.0030.02214.57
5.6.290.0140.01414.14
5.6.280.0030.03217.68
5.6.270.0030.02314.30
5.6.260.0110.00714.25
5.6.250.0060.01214.41
5.6.240.0030.02214.44
5.6.230.0000.02214.38
5.6.220.0030.02414.55
5.6.210.0110.04817.51
5.6.200.0070.04716.29
5.6.190.0050.05817.47
5.6.180.0250.05017.50
5.6.170.0100.03717.50
5.6.160.0130.05217.48
5.6.150.0100.05216.30
5.6.140.0060.05516.37
5.6.130.0050.06416.27
5.6.120.0070.05417.67
5.6.110.0060.03417.65
5.6.100.0030.03517.74
5.6.90.0050.03317.81
5.6.80.0050.06217.29
5.6.70.0060.02814.21
5.6.60.0070.02314.40
5.6.50.0100.02714.34
5.6.40.0060.01814.33
5.6.30.0110.01814.19
5.6.20.0030.02214.33
5.6.10.0090.02814.20
5.6.00.0000.03614.31
5.5.380.0070.01714.31
5.5.370.0030.02414.29
5.5.360.0100.01614.16
5.5.350.0230.05117.24
5.5.340.0050.03216.26
5.5.330.0030.04717.02
5.5.320.0300.03117.30
5.5.310.0230.05117.17
5.5.300.0030.06616.12
5.5.290.0070.04616.16
5.5.280.0070.05617.43
5.5.270.0080.05617.62
5.5.260.0100.05117.53
5.5.250.0070.05517.21
5.5.240.0100.05917.01
5.5.230.0040.02113.97
5.5.220.0140.02414.04
5.5.210.0070.01813.96
5.5.200.0040.01813.82
5.5.190.0000.02114.20
5.5.180.0070.01714.41
5.5.170.0070.02114.16
5.5.160.0030.02713.96
5.5.150.0000.02114.26
5.5.140.0030.02214.21
5.5.130.0030.02414.21
5.5.120.0030.01714.32
5.5.110.0060.01914.20
5.5.100.0030.02214.25
5.5.90.0030.02214.39
5.5.80.0100.02614.09
5.5.70.0040.03613.95
5.5.60.0000.02514.25
5.5.50.0030.03514.21
5.5.40.0030.03213.93
5.5.30.0060.01314.12
5.5.20.0060.01914.34
5.5.10.0030.02314.30
5.5.00.0060.01913.98

preferences:
37.25 ms | 400 KiB | 5 Q