3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Enter your code here, enjoy! function hmac($algo,$data,$passwd){ /* md5 and sha1 only */ $algo=strtolower($algo); echo $algo; $p=array('md5'=>'greatherH32','sha1'=>'H40'); if(strlen($passwd)>64) { $passwd=pack($p[$algo],$algo($passwd)); echo 'pass greater than 64'.chr(13); echo $passwd; } if(strlen($passwd)<64) { $passwd=str_pad($passwd,64,chr(0)); echo 'pass smaller than 64'.chr(13); echo $passwd; } $ipad=substr($passwd,0,64) ^ str_repeat(chr(0x36),64); echo 'ipad: '.$ipad.chr(13); $opad=substr($passwd,0,64) ^ str_repeat(chr(0x5C),64); echo 'opad: '.$opad.chr(13); $hashedIpadData =$algo($ipad.$data); echo 'hashedIpadData: '.$hashedIpadData.chr(13); $packedIpdatData=pack($p[$algo],$hashedIpadData); echo 'packedIpdatData: '.$packedIpdatData.chr(13); $opadPack = $opad.$packedIpdatData; echo 'opadPack: '.$opadPack.chr(13); return $algo($opadPack); } # XXX ePay.bg URL (https://devep2.datamax.bg/ep2/epay2_demo/ if POST to DEMO system) $submit_url = 'https://devep2.datamax.bg/ep2/epay2_demo/'; # XXX Secret word with which merchant make CHECKSUM on the ENCODED packet $secret = 'secret'; $min = 'D544248794'; $invoice = 1234; # XXX Invoice $sum = '22.80'; # XXX Ammount $exp_date = '01.08.2020'; # XXX Expiration date $descr = 'Test'; # XXX Description $data = <<<DATA MIN={$min} INVOICE={$invoice} AMOUNT={$sum} EXP_TIME={$exp_date} DESCR={$descr} DATA; # XXX Packet: # (MIN or EMAIL)= REQUIRED # INVOICE= REQUIRED # AMOUNT= REQUIRED # EXP_TIME= REQUIRED # DESCR= OPTIONAL $ENCODED = base64_encode($data); $CHECKSUM = hmac('sha1', $ENCODED, $secret); # XXX SHA-1 algorithm REQUIRED echo <<<HTML <HTML> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1251"> </head> <BODY TEXT=#000000 BGCOLOR=#FFFFFF> <p>{$ENCODED}</p> <p>{$CHECKSUM}</p> HTML; ?>

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)
8.3.60.0100.01018.30
8.3.50.0210.00722.12
8.3.40.0110.00718.93
8.3.30.0110.00719.02
8.3.20.0040.00420.33
8.3.10.0040.00423.72
8.3.00.0030.00519.02
8.2.180.0170.00316.50
8.2.170.0100.00722.96
8.2.160.0100.00320.39
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0090.00626.16
8.2.120.0060.00319.36
8.2.110.0060.00822.16
8.2.100.0040.00720.35
8.2.90.0040.00419.22
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0070.00318.04
8.2.50.0040.00418.07
8.2.40.0050.00319.95
8.2.30.0020.00518.22
8.2.20.0040.00417.84
8.2.10.0050.00318.04
8.2.00.0080.00017.69
8.1.280.0170.00025.92
8.1.270.0060.00323.97
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0060.00323.96
8.1.230.0110.00019.09
8.1.220.0000.00917.79
8.1.210.0090.00018.77
8.1.200.0040.00417.35
8.1.190.0040.00417.13
8.1.180.0030.00618.10
8.1.170.0080.00018.50
8.1.160.0000.00722.04
8.1.150.0040.00418.59
8.1.140.0040.00417.52
8.1.130.0030.00317.73
8.1.120.0040.00417.34
8.1.110.0000.00717.45
8.1.100.0040.00417.49
8.1.90.0000.00717.47
8.1.80.0080.00017.53
8.1.70.0070.00017.42
8.1.60.0030.00917.54
8.1.50.0030.00617.53
8.1.40.0000.00817.52
8.1.30.0040.00417.66
8.1.20.0040.00417.61
8.1.10.0000.00717.63
8.1.00.0000.00817.57
8.0.300.0070.00018.77
8.0.290.0070.00016.75
8.0.280.0050.00318.48
8.0.270.0030.00317.29
8.0.260.0000.00717.20
8.0.250.0000.00717.07
8.0.240.0080.00017.12
8.0.230.0000.00717.02
8.0.220.0070.00016.87
8.0.210.0000.00716.87
8.0.200.0030.00316.98
8.0.190.0000.00716.91
8.0.180.0040.00416.96
8.0.170.0080.00017.04
8.0.160.0070.00017.02
8.0.150.0040.00416.84
8.0.140.0050.00316.98
8.0.130.0030.00313.42
8.0.120.0000.00816.98
8.0.110.0000.00716.99
8.0.100.0070.00016.96
8.0.90.0030.00516.79
8.0.80.0120.00317.00
8.0.70.0000.00817.01
8.0.60.0000.00716.88
8.0.50.0000.00817.05
8.0.30.0130.00817.20
8.0.20.0080.01117.40
8.0.10.0000.00716.99
8.0.00.0100.00916.91
7.4.330.0000.00515.00
7.4.320.0030.00316.38
7.4.300.0000.00716.48
7.4.290.0030.00316.55
7.4.280.0030.00516.51
7.4.270.0040.00416.53
7.4.260.0040.00716.59
7.4.250.0040.00416.59
7.4.240.0030.00416.57
7.4.230.0050.00316.70
7.4.220.0100.00716.43
7.4.210.0060.00916.58
7.4.200.0040.00416.42
7.4.160.0060.01016.67
7.4.150.0140.00317.40
7.4.140.0090.00917.86
7.4.130.0090.00816.69
7.4.120.0090.00716.66
7.4.110.0160.00316.40
7.4.100.0110.00716.61
7.4.90.0140.01016.68
7.4.80.0150.00919.39
7.4.70.0130.00316.52
7.4.60.0050.01416.41
7.4.50.0050.00316.26
7.4.40.0030.01416.50
7.4.30.0120.00616.52
7.4.00.0040.01114.88
7.3.330.0050.00013.42
7.3.320.0050.00013.32
7.3.310.0040.00416.36
7.3.300.0000.00716.43
7.3.290.0070.00716.45
7.3.280.0130.00816.44
7.3.270.0090.00917.40
7.3.260.0060.01216.73
7.3.250.0080.01016.61
7.3.240.0070.01716.38
7.3.230.0080.01516.65
7.3.210.0110.00716.43
7.3.200.0110.00819.39
7.3.190.0060.01216.54
7.3.180.0090.00916.64
7.3.170.0070.01316.68
7.3.160.0080.00816.34
7.3.120.0130.00315.06
7.3.110.0060.00814.84
7.3.100.0120.00414.89
7.3.90.0040.01114.85
7.3.80.0030.00914.91
7.3.70.0030.01014.81
7.3.60.0060.01015.02
7.3.50.0080.00814.81
7.3.40.0070.00714.97
7.3.30.0070.00714.96
7.3.20.0120.00316.85
7.3.10.0110.00316.66
7.3.00.0060.00916.43
7.2.330.0180.00616.88
7.2.320.0070.01316.62
7.2.310.0150.00316.87
7.2.300.0080.00816.87
7.2.290.0070.01016.84
7.2.240.0100.00314.78
7.2.230.0070.00715.41
7.2.220.0040.00815.35
7.2.210.0070.00715.35
7.2.200.0000.01415.32
7.2.190.0090.00615.11
7.2.180.0000.01815.14
7.2.170.0120.00314.92
7.2.160.0110.00414.89
7.2.150.0030.00916.69
7.2.140.0060.00917.00
7.2.130.0070.01116.91
7.2.120.0060.00917.03
7.2.110.0130.00316.88
7.2.100.0000.01017.00
7.2.90.0080.00817.04
7.2.80.0070.01016.96
7.2.70.0000.01416.88
7.2.60.0090.00916.69
7.2.50.0080.00517.01
7.2.40.0100.00716.95
7.2.30.0100.00716.90
7.2.20.0030.01417.00
7.2.10.0060.00917.13
7.2.00.0030.01018.05
7.1.330.0000.01215.83
7.1.320.0100.00715.73
7.1.310.0040.01115.68
7.1.300.0000.01315.81
7.1.290.0080.00615.84
7.1.280.0030.00715.88
7.1.270.0070.00415.80
7.1.260.0040.01116.03
7.1.250.0040.01115.79
7.1.100.0040.00718.19
7.1.70.0040.00417.29
7.1.60.0100.01319.70
7.1.50.0070.01816.95
7.1.00.0030.07722.35
7.0.200.0080.00016.84
7.0.140.0030.07321.96
7.0.60.0330.06719.88
7.0.50.0130.07317.90
7.0.40.0070.04019.96
7.0.30.0230.05020.20
7.0.20.0300.07720.10
7.0.10.0030.08020.12
7.0.00.0130.07020.29
5.6.280.0070.06721.09
5.6.210.0070.03720.53
5.6.200.0130.07318.24
5.6.190.0100.04020.58
5.6.180.0300.06020.50
5.6.170.0170.04320.50
5.6.160.0030.04320.43
5.6.150.0070.04718.23
5.6.140.0100.06718.18
5.6.130.0030.09018.18
5.6.120.0100.09320.91
5.6.110.0000.06721.03
5.6.100.0030.09021.20
5.6.90.0030.09020.96
5.6.80.0130.07720.43
5.5.350.0130.04320.43
5.5.340.0100.08018.09
5.5.330.0070.09020.21
5.5.320.0130.04020.34
5.5.310.0170.04320.30
5.5.300.0200.06017.98
5.5.290.0070.03718.08
5.5.280.0030.08720.74
5.5.270.0030.04020.96
5.5.260.0100.07720.96
5.5.250.0000.06720.71
5.5.240.0300.07020.28
5.4.450.0130.04719.42
5.4.440.0130.05019.49
5.4.430.0270.05019.52
5.4.420.0230.07319.54
5.4.410.0330.06019.42
5.4.400.0130.04319.32
5.4.390.0170.05019.22
5.4.380.0230.05319.15
5.4.370.0200.08018.88
5.4.360.0270.06719.14
5.4.350.0170.04019.22
5.4.340.0300.06019.08
5.4.320.0270.05719.23
5.4.310.0230.07319.15
5.4.300.0270.06719.09
5.4.290.0230.04718.99
5.4.280.0230.07319.22
5.4.270.0230.05719.08
5.4.260.0200.08318.95
5.4.250.0270.06719.30
5.4.240.0230.05718.98
5.4.230.0200.07019.05
5.4.220.0170.08319.05
5.4.210.0170.04719.14
5.4.200.0230.03319.05
5.4.190.0200.07318.93
5.4.180.0230.04719.08
5.4.170.0330.06318.86
5.4.160.0200.05019.14
5.4.150.0270.05719.07
5.4.140.0330.06016.32
5.4.130.0200.05716.31
5.4.120.0300.06016.29
5.4.110.0270.06716.42
5.4.100.0270.07016.40
5.4.90.0270.06316.20
5.4.80.0200.06716.17
5.4.70.0200.04016.36
5.4.60.0200.07716.56
5.4.50.0230.04716.18
5.4.40.0200.07016.25
5.4.30.0230.04716.38
5.4.20.0170.05016.42
5.4.10.0170.04016.24
5.4.00.0200.07015.80
5.3.290.0330.03714.80
5.3.280.0230.07714.59
5.3.270.0200.06014.55
5.3.260.0230.06314.64
5.3.250.0230.07014.73
5.3.240.0230.07014.84
5.3.230.0330.04014.73
5.3.220.0230.03714.59
5.3.210.0370.06014.62
5.3.200.0270.07314.55
5.3.190.0230.05014.50
5.3.180.0300.04714.66
5.3.170.0270.06314.57
5.3.160.0270.07314.70
5.3.150.0200.07314.55
5.3.140.0300.04314.66
5.3.130.0300.06714.57
5.3.120.0270.04314.58
5.3.110.0230.07314.46
5.3.100.0230.05713.95
5.3.90.0230.07314.20
5.3.80.0270.04314.15
5.3.70.0270.05014.11
5.3.60.0230.06313.94
5.3.50.0230.06713.94
5.3.40.0300.06713.95
5.3.30.0100.06013.99
5.3.20.0200.05713.71
5.3.10.0270.04013.76
5.3.00.0170.06713.58
5.2.170.0200.05713.22
5.2.160.0270.03313.22
5.2.150.0100.06713.22
5.2.140.0100.04013.22
5.2.130.0070.03713.22
5.2.120.0170.03713.22
5.2.110.0170.06013.22
5.2.100.0130.06713.22
5.2.90.0230.05713.22
5.2.80.0270.03713.22
5.2.70.0200.05013.22
5.2.60.0200.05313.22
5.2.50.0200.03713.22
5.2.40.0130.06013.22
5.2.30.0170.05013.22
5.2.20.0230.02713.22
5.2.10.0130.05713.22
5.2.00.0130.04713.22
5.1.60.0270.04013.22
5.1.50.0170.04713.22
5.1.40.0230.04313.22
5.1.30.0300.04013.22
5.1.20.0170.05313.22
5.1.10.0130.06013.22
5.1.00.0130.04713.22
5.0.50.0100.04013.22
5.0.40.0100.03013.22
5.0.30.0100.06013.22
5.0.20.0100.03013.22
5.0.10.0070.02313.22
5.0.00.0030.04013.22
4.4.90.0200.02713.22
4.4.80.0070.02013.22
4.4.70.0100.03313.22
4.4.60.0070.01713.22
4.4.50.0070.03713.22
4.4.40.0100.02713.22
4.4.30.0130.02313.22
4.4.20.0070.03013.22
4.4.10.0130.02313.22
4.4.00.0100.05013.22
4.3.110.0030.02713.22
4.3.100.0100.03313.22
4.3.90.0030.02313.22
4.3.80.0100.03713.22
4.3.70.0070.02313.22
4.3.60.0070.02013.22
4.3.50.0070.03313.22
4.3.40.0070.03713.22
4.3.30.0030.02013.22
4.3.20.0030.04013.22
4.3.10.0100.01713.22
4.3.00.0030.03313.22

preferences:
48.22 ms | 401 KiB | 5 Q