3v4l.org

run code in 300+ PHP versions simultaneously
<?PHP FUNCTION bin2text($bin_str) { $text_str = ''; $chars = EXPLODE("\n", CHUNK_SPLIT(STR_REPLACE("\n", '', $bin_str), 8)); $_I = COUNT($chars); FOR($i = 0; $i < $_I; $text_str .= CHR(BINDEC($chars[$i])), $i ); RETURN $text_str; } FUNCTION text2bin($txt_str) { $len = STRLEN($txt_str); $bin = ''; FOR($i = 0; $i < $len; $i ) { $bin .= STRLEN(DECBIN(ORD($txt_str[$i]))) < 8 ? STR_PAD(DECBIN(ORD($txt_str[$i])), 8, 0, STR_PAD_LEFT) : DECBIN(ORD($txt_str[$i])); } RETURN $bin; } PRINT text2bin('Isn\'t this cool?'); ?>

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.0860.81250.49
8.3.50.0950.87250.11
8.3.40.0430.37236.33
8.3.30.0430.37436.34
8.3.20.0230.20737.85
8.3.10.0270.18939.48
8.3.00.0330.19735.73
8.2.180.0600.83950.04
8.2.170.0530.37436.38
8.2.160.0660.35937.66
8.2.150.0170.19536.44
8.2.140.0170.19138.18
8.2.130.0300.18135.68
8.2.120.0300.18935.16
8.2.110.0130.33338.20
8.2.100.0400.32535.07
8.2.90.0070.32536.59
8.2.80.0170.32135.11
8.2.70.0360.33634.90
8.2.60.0170.36835.19
8.2.50.0130.32035.01
8.2.40.0170.29536.60
8.2.30.0130.31735.65
8.2.20.0030.36735.27
8.2.10.0130.32235.58
8.2.00.0130.32135.46
8.1.280.0700.81151.17
8.1.270.0230.19037.55
8.1.260.0230.19137.97
8.1.250.0300.19139.46
8.1.240.0230.33038.36
8.1.230.0400.33434.54
8.1.220.0230.31735.32
8.1.210.0170.32734.59
8.1.200.0240.41634.41
8.1.190.0300.31534.73
8.1.180.0200.32435.04
8.1.170.0430.29636.11
8.1.160.0130.31139.52
8.1.150.0200.31736.34
8.1.140.0100.32534.78
8.1.130.0100.32135.16
8.1.120.0130.32334.93
8.1.110.0200.37734.82
8.1.100.0170.32034.93
8.1.90.0100.34434.95
8.1.80.0100.34834.96
8.1.70.0230.30234.79
8.1.60.0130.37035.08
8.1.50.0100.36634.93
8.1.40.0170.36435.04
8.1.30.0030.38035.15
8.1.20.0100.36235.12
8.1.10.0170.78650.98
8.1.00.0170.78350.86
8.0.300.0530.66950.20
8.0.290.0370.73850.13
8.0.280.0170.73451.77
8.0.270.0130.76150.58
8.0.260.0430.75650.51
8.0.250.0230.73650.28
8.0.240.0230.70050.20
8.0.230.0400.79950.30
8.0.220.0300.67650.13
8.0.210.0230.69750.12
8.0.200.0430.70850.30
8.0.190.0330.78250.16
8.0.180.0430.78550.24
8.0.170.0330.78450.29
8.0.160.0130.79450.30
8.0.150.0300.77550.07
8.0.140.0370.77250.17
8.0.130.0431.62078.70
8.0.120.0200.77450.20
8.0.110.0430.75950.07
8.0.100.0230.77150.20
8.0.90.0300.75750.11
8.0.80.0731.02650.19
8.0.70.0300.78150.23
8.0.60.0370.76550.27
8.0.50.0330.77050.21
8.0.30.0760.86450.53
8.0.20.1131.15550.36
8.0.10.0270.77550.29
8.0.00.0871.04049.99
7.4.330.0400.75147.12
7.4.320.0530.74849.88
7.4.300.0330.76449.85
7.4.290.0270.81749.80
7.4.280.0270.82349.83
7.4.270.0300.80649.74
7.4.260.0200.85349.82
7.4.250.0370.87249.72
7.4.240.0180.86249.96
7.4.230.0270.86650.03
7.4.220.0861.92449.41
7.4.210.1031.73450.01
7.4.200.0200.85950.00
7.4.160.0691.69049.92
7.4.150.1441.85249.82
7.4.140.0921.90147.99
7.4.130.0921.69849.91
7.4.120.0791.65549.83
7.4.110.0761.76349.93
7.4.100.0861.79449.85
7.4.90.0901.63049.78
7.4.80.0701.61549.87
7.4.70.1081.60650.06
7.4.60.0821.66549.89
7.4.50.0130.60449.57
7.4.40.1221.59249.66
7.4.30.1042.00449.01
7.3.330.0771.76178.71
7.3.320.0601.64578.87
7.3.310.0270.81349.68
7.3.300.0230.79349.58
7.3.290.1041.80949.67
7.3.280.1021.88749.02
7.3.270.1081.89547.63
7.3.260.1221.65149.83
7.3.250.1191.78349.06
7.3.240.0891.72149.73
7.3.230.1151.67950.05
7.3.210.0821.62649.97
7.3.200.1061.96749.63
7.3.190.0961.74549.95
7.3.180.0891.63049.95
7.3.170.0861.72349.85
7.3.160.0991.76149.75
7.3.10.6671.42346.20
7.3.00.3921.85147.94
7.2.330.1321.89949.77
7.2.320.1062.25050.20
7.2.310.0931.64150.15
7.2.300.1081.74449.93
7.2.290.0861.64850.16
7.2.130.0701.93548.28
7.2.120.0931.85648.85
7.2.110.0881.81648.82
7.2.100.0831.85548.57
7.2.90.0891.83648.33
7.2.80.1101.36046.87
7.2.70.0671.54946.92
7.2.60.0881.37447.77
7.2.50.0850.93846.66
7.2.40.1001.50247.05
7.2.30.0731.74246.76
7.2.20.0771.50746.91
7.2.10.0731.68446.71
7.2.00.0451.61750.04
7.1.250.0932.05245.57
7.1.200.0531.77947.80
7.1.100.3791.92649.88
7.1.70.0231.80849.09
7.1.60.0131.67749.38
7.1.50.0231.55349.21
7.1.00.0231.88354.21
7.0.200.6491.84046.74
7.0.60.0301.72753.43
7.0.50.0331.71051.31
7.0.40.0371.69749.93
7.0.30.0971.73349.89
7.0.20.0772.07749.81
7.0.10.0201.88349.80
7.0.00.0201.68349.71
5.6.280.0132.48743.77
5.6.210.0102.49046.87
5.6.200.0072.49343.82
5.6.190.0072.49346.19
5.6.180.0302.47045.48
5.6.170.0332.46745.44
5.6.160.0202.48046.81
5.6.150.0202.48043.47
5.6.140.0132.48743.62
5.6.130.0202.48040.12
5.6.120.0172.48345.63
5.6.110.0272.47346.59
5.6.100.0072.49346.25
5.6.90.0172.48347.55
5.6.80.0002.50045.94
5.6.70.0302.47048.46
5.5.350.4332.06743.50
5.5.340.0172.48341.89
5.5.330.0102.49044.20
5.5.320.0472.45344.20
5.5.310.0402.46043.90
5.5.300.0232.47741.72
5.5.290.0172.48342.44
5.5.280.0172.48344.57
5.5.270.0172.48344.49
5.5.260.0102.49045.88
5.5.250.0132.48741.19
5.5.240.0272.47345.66
5.4.450.0631.20326.14
5.4.440.0671.15725.67
5.4.430.0631.64727.66
5.4.420.0671.70728.51
5.4.410.0771.70728.66
5.4.400.1031.46026.92
5.4.390.0871.36025.84
5.4.380.0971.70328.28
5.4.370.1072.04329.47
5.4.360.0771.61727.64
5.4.350.1001.56727.27
5.4.340.0671.58327.90
5.4.320.0831.65328.05
5.4.310.0771.55026.93
5.4.300.0871.64327.57
5.4.290.1071.38725.51
5.4.280.0931.29325.05
5.4.270.1001.28025.00
5.4.260.1071.46024.11
5.4.250.1201.14324.22
5.4.240.1172.16328.81
5.4.230.1232.36331.01
5.4.220.1732.23330.06
5.4.210.1332.14727.90
5.4.200.0731.60026.88
5.4.190.0831.43326.15
5.4.180.0901.50326.21
5.4.170.0831.63025.77
5.4.160.1001.79026.59
5.4.150.1131.61327.11
5.4.140.0471.19322.14
5.4.130.0431.16722.50
5.4.120.0630.98321.51
5.4.110.0870.90321.05
5.4.100.0771.05321.06
5.4.90.1131.12321.12
5.4.80.1071.15722.03
5.4.70.0132.48338.59
5.4.60.0332.46340.53
5.4.50.0232.47340.38
5.4.40.0172.48040.05
5.4.30.0132.48341.13
5.4.20.0072.49041.24

preferences:
61.73 ms | 401 KiB | 5 Q