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=utf8_encode(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 mb_internal_encoding() . '<br />'; echo mb_regex_encoding(); 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.0140.00718.43
8.3.50.0100.01021.08
8.3.40.0110.01118.79
8.3.30.0000.01420.35
8.3.20.0070.00020.20
8.3.10.0040.00422.05
8.3.00.0050.00322.57
8.2.180.0060.00916.75
8.2.170.0110.00322.96
8.2.160.0190.00320.40
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00420.79
8.2.110.0030.00619.33
8.2.100.0090.00318.03
8.2.90.0000.00819.22
8.2.80.0030.00519.21
8.2.70.0040.00417.63
8.2.60.0040.00417.93
8.2.50.0040.00418.07
8.2.40.0040.00418.15
8.2.30.0050.00219.59
8.2.20.0030.00617.97
8.2.10.0030.00517.82
8.2.00.0060.00318.00
8.1.280.0110.00425.92
8.1.270.0040.00423.99
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0090.00022.59
8.1.230.0000.01220.89
8.1.220.0000.00918.77
8.1.210.0090.00019.09
8.1.200.0000.00917.23
8.1.190.0060.00317.50
8.1.180.0080.00018.10
8.1.170.0040.00418.61
8.1.160.0000.00818.88
8.1.150.0000.00818.64
8.1.140.0000.00717.50
8.1.130.0080.00017.93
8.1.120.0040.00417.57
8.1.110.0040.00417.42
8.1.100.0070.00017.54
8.1.90.0040.00417.49
8.1.80.0080.00017.52
8.1.70.0030.00517.52
8.1.60.0030.00617.61
8.1.50.0040.00417.62
8.1.40.0030.00817.45
8.1.30.0080.00017.50
8.1.20.0060.00317.73
8.1.10.0000.00817.49
8.1.00.0040.00417.45
8.0.300.0040.00420.01
8.0.290.0050.00317.18
8.0.280.0070.00018.54
8.0.270.0040.00417.19
8.0.260.0040.00416.80
8.0.250.0040.00417.07
8.0.240.0000.00917.11
8.0.230.0070.00017.02
8.0.220.0000.00716.99
8.0.210.0000.00716.99
8.0.200.0040.00417.10
8.0.190.0070.00016.96
8.0.180.0000.00817.03
8.0.170.0080.00017.05
8.0.160.0040.00417.04
8.0.150.0000.00717.04
8.0.140.0040.00416.89
8.0.130.0030.00313.39
8.0.120.0040.00416.93
8.0.110.0000.00716.99
8.0.100.0000.00716.89
8.0.90.0050.00317.12
8.0.80.0060.00916.99
8.0.70.0040.00417.05
8.0.60.0040.00416.95
8.0.50.0050.00216.84
8.0.30.0140.00517.21
8.0.20.0090.00817.40
8.0.10.0070.00017.03
8.0.00.0160.00516.78
7.4.330.0050.00015.04
7.4.320.0060.00016.54
7.4.300.0030.00316.47
7.4.290.0070.00016.41
7.4.280.0030.00316.53
7.4.270.0040.00416.53
7.4.260.0030.00313.38
7.4.250.0050.00216.59
7.4.240.0040.00416.56
7.4.230.0030.00516.55
7.4.220.0100.00716.64
7.4.210.0120.00916.60
7.4.200.0070.00016.55
7.4.190.0030.00316.51
7.4.160.0070.01316.45
7.4.150.0170.00017.40
7.4.140.0090.00917.86
7.4.130.0070.01116.69
7.4.120.0130.00816.52
7.4.110.0070.01016.62
7.4.100.0120.00616.70
7.4.90.0070.01316.68
7.4.80.0080.01119.39
7.4.70.0100.00716.42
7.4.60.0100.00716.53
7.4.50.0080.00016.23
7.4.40.0070.00322.77
7.4.30.0100.00716.50
7.4.00.0080.00814.98
7.3.330.0000.00513.55
7.3.320.0000.00513.25
7.3.310.0000.00816.33
7.3.300.0000.00716.30
7.3.290.0070.00716.49
7.3.280.0090.01016.45
7.3.270.0100.01017.40
7.3.260.0120.00416.46
7.3.250.0110.00616.45
7.3.240.0110.01116.62
7.3.230.0080.00816.70
7.3.210.0100.00716.54
7.3.200.0150.00819.39
7.3.190.0030.01316.55
7.3.180.0030.01316.50
7.3.170.0140.00416.51
7.3.160.0130.00616.49
7.3.120.0100.00714.80
7.2.330.0100.00716.85
7.2.320.0150.00316.62
7.2.310.0040.01216.69
7.2.300.0130.00916.75
7.2.290.0170.00316.74
7.2.00.0000.01219.16
7.1.100.0210.00016.17
7.1.70.0030.00317.22
7.1.60.0140.01119.17
7.1.50.0180.00616.64
7.1.00.0030.03322.42
7.0.200.0030.00516.69
7.0.140.0030.07722.15
7.0.60.0070.05020.05
7.0.50.0000.05017.91
7.0.40.0070.07020.12
7.0.30.0200.04020.19
7.0.20.0270.08320.23
7.0.10.0100.08320.16
7.0.00.0000.04720.25
5.6.280.0030.07021.10
5.6.210.0000.08720.74
5.6.200.0270.03718.19
5.6.190.0030.07320.33
5.6.180.0430.04020.57
5.6.170.0400.05720.48
5.6.160.0070.08320.58
5.6.150.0030.06018.17
5.6.140.0070.07018.13
5.6.130.0100.06718.23
5.6.120.0030.06321.10
5.6.110.0000.06721.06
5.6.100.0030.04321.05
5.6.90.0030.07721.09
5.6.80.0130.07020.50
5.5.350.0270.08020.31
5.5.340.0170.07018.04
5.5.330.0100.07320.43
5.5.320.0100.08020.38
5.5.310.0300.06320.34
5.5.300.0100.03718.01
5.5.290.0070.08318.02
5.5.280.0130.04720.69
5.5.270.0070.04720.79
5.5.260.0170.07720.90
5.5.250.0070.06720.70
5.5.240.0030.07720.34
5.4.450.3900.04319.41
5.4.440.4070.03019.64
5.4.430.4070.03719.19
5.4.420.4030.03319.67
5.4.410.3630.03319.34
5.4.400.3770.03319.14
5.4.390.3370.03719.00
5.4.380.3630.03719.14
5.4.370.3530.02718.88
5.4.360.3470.04019.16
5.4.350.4030.03718.88
5.4.340.4170.03718.99
5.4.320.3430.03019.09
5.4.310.3300.04318.95
5.4.300.3230.04318.85
5.4.290.3000.04019.31
5.4.280.3730.03719.09
5.4.270.4030.03719.32
5.4.260.3570.04019.15
5.4.250.3400.04019.08
5.4.240.3400.04019.13
5.4.230.3400.04018.84
5.4.220.3430.04018.98
5.4.210.3270.04019.30
5.4.200.3900.03019.21
5.4.190.3700.03719.23
5.4.180.3200.03718.83
5.4.170.2900.03719.15
5.4.160.2900.03718.83
5.4.150.3200.04018.98
5.4.140.3230.02716.41
5.4.130.3070.03716.37
5.4.120.2900.03716.50
5.4.110.3570.03716.54
5.4.100.3270.03316.29
5.4.90.2930.04016.37
5.4.80.3400.03316.57
5.4.70.3530.04016.25
5.4.60.3030.03316.44
5.4.50.3200.04016.34
5.4.40.3270.03016.54
5.4.30.3570.03316.34
5.4.20.3500.02716.54
5.4.10.3730.03716.35
5.4.00.3770.03715.85
5.3.290.3870.02714.80
5.3.280.3530.04014.58
5.3.270.3100.04314.52
5.3.260.3200.03014.67
5.3.250.3130.03714.84
5.3.240.3000.03014.84
5.3.230.3230.03314.62
5.3.220.3700.04014.58
5.3.210.3070.04014.64
5.3.200.3430.03014.48
5.3.190.3030.04014.57
5.3.180.3430.03314.66
5.3.170.3330.04314.57
5.3.160.3430.04014.67
5.3.150.3400.03314.71
5.3.140.3300.03714.47
5.3.130.3170.03314.65
5.3.120.3730.03714.60
5.3.110.3530.03714.56
5.3.100.3300.04713.95
5.3.90.3600.04313.95
5.3.80.3370.04013.96
5.3.70.3070.04014.05
5.3.60.3500.03713.93
5.3.50.3330.03313.94
5.3.40.4170.04013.99
5.3.30.4070.03713.83
5.3.20.3770.03013.62
5.3.10.3930.03013.75
5.3.00.4030.03313.56
5.2.170.3130.02711.25
5.2.160.3030.02711.09
5.2.150.3430.02711.14
5.2.140.3470.03011.25
5.2.130.3070.03011.23
5.2.120.3470.02711.29
5.2.110.3530.02311.34
5.2.100.3070.03311.05
5.2.90.2500.03011.15
5.2.80.2470.03311.02
5.2.70.3070.02311.09
5.2.60.2870.03011.07
5.2.50.2630.02311.09
5.2.40.2530.01011.02
5.2.30.2500.02711.07
5.2.20.2100.02710.91
5.2.10.2030.03010.80
5.2.00.2270.03710.80
5.1.60.2570.02310.01
5.1.50.2130.02710.12
5.1.40.2400.0279.91
5.1.30.2430.02710.37
5.1.20.2970.02710.39
5.1.10.2700.03010.02
5.1.00.2600.03010.19
5.0.50.1270.0238.98
5.0.40.1270.0208.99
5.0.30.1470.0339.02
5.0.20.1300.0209.03
5.0.10.1230.0209.04
5.0.00.1430.0339.04
4.4.90.1330.0208.80
4.4.80.1030.0178.83
4.4.70.1030.0138.87
4.4.60.0770.0178.88
4.4.50.1430.0178.88
4.4.40.1200.0238.92
4.4.30.1270.0138.92
4.4.20.1530.0208.96
4.4.10.1300.0178.98
4.4.00.1330.0338.98
4.3.110.1530.0209.00
4.3.100.1300.0179.02
4.3.90.1170.0139.04
4.3.80.1630.0279.05
4.3.70.1630.0139.07
4.3.60.1470.0179.07
4.3.50.1230.0179.10
4.3.40.1370.0239.12
4.3.30.0670.0179.13
4.3.20.0870.0239.13
4.3.10.0770.0179.14
4.3.00.0800.0179.15

preferences:
40.08 ms | 401 KiB | 5 Q