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('Isnt 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.0700.79850.39
8.3.50.0850.79750.20
8.3.40.0700.35036.51
8.3.30.0530.35536.25
8.3.20.0300.19336.24
8.3.10.0200.20936.49
8.3.00.0260.19235.42
8.2.180.0700.84250.03
8.2.170.0440.37136.44
8.2.160.0460.38936.21
8.2.150.0170.20236.22
8.2.140.0330.18636.09
8.2.130.0330.18338.03
8.2.120.0500.17336.25
8.2.110.0370.32637.89
8.2.100.0270.32335.19
8.2.90.0330.32437.01
8.2.80.0200.29136.83
8.2.70.0260.31235.04
8.2.60.0130.33235.30
8.2.50.0300.36234.80
8.2.40.0130.31435.70
8.2.30.0170.32335.58
8.2.20.0170.38435.14
8.2.10.0130.32235.16
8.2.00.0230.31835.27
8.1.280.0800.79351.91
8.1.270.0230.19139.66
8.1.260.0200.20035.43
8.1.250.0270.19138.22
8.1.240.0170.33138.66
8.1.230.0400.29738.38
8.1.220.0270.31635.06
8.1.210.0270.31636.11
8.1.200.0260.34334.75
8.1.190.0260.31734.82
8.1.180.0170.31834.64
8.1.170.0130.31536.10
8.1.160.0170.31436.23
8.1.150.0100.33036.02
8.1.140.0260.30634.87
8.1.130.0130.29235.31
8.1.120.0100.32134.84
8.1.110.0070.33534.84
8.1.100.0130.32334.91
8.1.90.0170.33034.94
8.1.80.0070.33234.81
8.1.70.0200.30734.81
8.1.60.0260.36435.08
8.1.50.0200.35734.99
8.1.40.0130.36835.09
8.1.30.0230.35935.00
8.1.20.0100.36535.01
8.1.10.0170.77850.99
8.1.00.0230.77451.12
8.0.300.0360.75053.22
8.0.290.0230.74150.02
8.0.280.0300.72251.72
8.0.270.0370.72850.59
8.0.260.0200.73050.16
8.0.250.0270.72350.29
8.0.240.0430.69750.33
8.0.230.0230.70250.26
8.0.220.0230.67650.18
8.0.210.0370.68150.13
8.0.200.0200.73250.21
8.0.190.0230.77650.14
8.0.180.0130.80250.18
8.0.170.0300.77750.16
8.0.160.0300.77250.24
8.0.150.0500.77450.24
8.0.140.0590.78250.07
8.0.130.0501.60278.75
8.0.120.0130.78550.21
8.0.110.0330.77050.27
8.0.100.0430.78850.23
8.0.90.0270.75850.18
8.0.80.0631.05450.19
8.0.70.0330.79550.11
8.0.60.0200.80250.28
8.0.50.0400.76150.14
8.0.30.0570.84150.35
8.0.20.0921.09650.29
8.0.10.0200.78650.32
8.0.00.1471.39750.11
7.4.330.0200.74646.36
7.4.320.0130.77949.90
7.4.300.0500.92149.84
7.4.290.0270.80949.92
7.4.280.0200.81949.85
7.4.270.0300.81249.83
7.4.260.0471.75678.66
7.4.250.0230.87049.73
7.4.240.0270.85449.92
7.4.230.0230.86949.73
7.4.220.0991.90847.87
7.4.210.0831.69449.86
7.4.200.0170.88149.91
7.4.190.0400.84149.94
7.4.160.0561.62649.91
7.4.150.1091.60049.94
7.4.140.1351.87647.85
7.4.130.1211.78949.80
7.4.120.0921.62549.80
7.4.110.1251.99649.89
7.4.100.1231.70850.06
7.4.90.1001.59949.89
7.4.80.1382.08849.83
7.4.70.1211.82349.97
7.4.60.0501.59049.93
7.4.50.0100.58149.74
7.4.40.0331.77949.75
7.4.30.0931.59950.05
7.3.330.1021.88276.61
7.3.320.0831.62778.82
7.3.310.0330.82949.75
7.3.300.0300.79349.73
7.3.290.0711.71649.25
7.3.280.1121.77049.70
7.3.270.1221.83349.83
7.3.260.1321.87249.97
7.3.250.1091.74949.77
7.3.240.1581.74649.95
7.3.230.1111.72549.87
7.3.210.1151.77449.70
7.3.200.1512.05247.94
7.3.190.1051.79549.79
7.3.180.0831.78149.67
7.3.170.0861.63149.64
7.3.160.1221.58349.69
7.2.330.0961.87849.88
7.2.320.1122.05750.03
7.2.310.1051.94350.19
7.2.300.1121.92749.99
7.2.290.1191.78050.13
7.2.101.0121.15445.77
7.1.220.6091.00643.62
5.6.380.0382.19031.08

preferences:
96.96 ms | 401 KiB | 5 Q