3v4l.org

run code in 300+ PHP versions simultaneously
<?php function decode(string $phrase): string { $dictionary = [ 1 => 'а', 2 => 'е', 3 => 'ё', 4 => 'и', 5 => 'й', 6 => 'о', 7 => 'у', 8 => 'э', 9 => 'ю', 10 => 'я', 11 => 'б', 12 => 'в', 13 => 'г', 14 => 'д', 15 => 'ж', 16 => 'з', 17 => 'к', 18 => 'л', 19 => 'м', 20 => 'н', 21 => 'п', 22 => 'р', 23 => 'с', 24 => 'т', 25 => 'ф', 26 => 'х', 27 => 'ц', 28 => 'ч', 29 => 'ш', 30 => 'щ', 31 => 'ь', 32 => 'ы', 33 => 'ъ', ]; $words = explode(' ', $phrase); $result = ''; foreach ($words as $word) { $letters = explode('.', $word); $result .= ' ' . implode('', array_map(function ($value) use ($dictionary) { $index = (int) $value; if ($index < 1 || $index > 33) { return $value; } return $dictionary[(int)$value]; }, $letters)); } return $result; } echo decode('12.6.24 21.6.28.2.19.7 19.20.2 17.728.29.2 11.32.24.31 6.12.20.6.19.76.19.4 6.23.7.15.14.1.9.24 19.2.20.10 21.22.2.15.12.3 , 28.2.19 7.16.20.1.9.24.');

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.0150.00318.32
8.3.50.0120.00318.31
8.3.40.0120.00318.78
8.3.30.0110.00318.86
8.3.20.0040.00420.33
8.3.10.0040.00423.69
8.3.00.0000.00819.38
8.2.180.0140.00718.29
8.2.170.0150.00022.96
8.2.160.0090.00620.52
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0070.00022.21
8.2.120.0070.00026.35
8.2.110.0110.00021.11
8.2.100.0070.00417.84
8.2.90.0040.00417.97
8.2.80.0060.00319.20
8.2.70.0000.01018.05
8.2.60.0030.00618.05
8.2.50.0030.00618.16
8.2.40.0060.00320.42
8.2.30.0000.00719.34
8.2.20.0060.00318.14
8.2.10.0050.00218.14
8.2.00.0000.00818.34
8.1.280.0140.00325.92
8.1.270.0000.00820.38
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0040.00422.14
8.1.230.0060.00620.97
8.1.220.0040.00417.78
8.1.210.0000.00818.77
8.1.200.0000.00817.35
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0080.00018.66
8.1.160.0050.00218.84
8.1.150.0050.00318.78
8.1.140.0000.00717.64
8.1.130.0070.00018.90
8.1.120.0040.00417.52
8.1.110.0110.00017.49
8.1.100.0090.00017.48
8.1.90.0040.00417.45
8.1.80.0000.00817.36
8.1.70.0050.00517.48
8.1.60.0080.00017.61
8.1.50.0000.00817.54
8.1.40.0050.00217.43
8.1.30.0030.00517.67
8.1.20.0060.00317.55
8.1.10.0080.00017.62
8.1.00.0080.00017.48
8.0.300.0070.00020.13
8.0.290.0000.00816.63
8.0.280.0030.00318.45
8.0.270.0040.00417.28
8.0.260.0000.00816.75
8.0.250.0040.00417.00
8.0.240.0050.00316.91
8.0.230.0040.00417.00
8.0.220.0030.00616.92
8.0.210.0040.00416.93
8.0.200.0040.00416.96
8.0.190.0030.00517.02
8.0.180.0040.00416.98
8.0.170.0030.00616.85
8.0.160.0000.00716.84
8.0.150.0030.01016.94
8.0.140.0000.00716.86
8.0.130.0060.00013.29
8.0.120.0060.00316.91
8.0.110.0040.00416.95
8.0.100.0040.00416.85
8.0.90.0040.00416.92
8.0.80.0000.01416.95
8.0.70.0050.00216.79
8.0.60.0000.00716.88
8.0.50.0000.00716.77
8.0.30.0090.01017.03
8.0.20.0060.01417.40
8.0.10.0040.00417.02
8.0.00.0110.00716.74
7.4.330.0060.00015.55
7.4.320.0030.00316.62
7.4.300.0000.00616.43
7.4.290.0030.00316.52
7.4.280.0070.00016.62
7.4.270.0030.00316.53
7.4.260.0040.00416.57
7.4.250.0070.00016.52
7.4.240.0070.00016.60
7.4.230.0030.00316.40
7.4.220.0070.00016.65
7.4.210.0070.00716.65
7.4.200.0000.00716.63
7.4.160.0100.00716.52
7.4.150.0120.00617.40
7.4.140.0110.00717.86
7.4.130.0100.00716.56
7.4.120.0100.01016.55
7.4.110.0120.00416.57
7.4.100.0130.00316.52
7.4.90.0070.01016.66
7.4.80.0090.01519.39
7.4.70.0120.00616.68
7.4.60.0080.00816.65
7.4.50.0090.00916.60
7.4.40.0120.00916.55
7.4.00.0070.00714.79
7.3.330.0030.00313.28
7.3.320.0030.00313.32
7.3.310.0040.00216.07
7.3.300.0000.00716.25
7.3.290.0070.00816.29
7.3.280.0150.00616.34
7.3.270.0180.01517.40
7.3.260.0090.01116.43
7.3.250.0130.00816.49
7.3.240.0080.01216.52
7.3.230.0150.00316.59
7.3.210.0060.01016.43
7.3.200.0070.01016.55
7.3.190.0100.00616.38
7.3.180.0170.00416.67
7.3.170.0140.00316.48
7.3.160.0090.00816.40
7.3.10.0130.01316.19
7.3.00.0160.00316.50
7.2.330.0060.01116.58
7.2.320.0060.01316.81
7.2.310.0120.00616.57
7.2.300.0070.01016.68
7.2.290.0040.01716.64
7.2.130.0110.00816.64
7.2.120.0150.00716.75
7.2.110.0140.01016.74
7.2.100.0070.01716.59
7.2.90.0220.00816.72
7.2.80.0150.00616.36
7.2.70.0120.00616.71
7.2.60.0050.01216.72
7.2.50.0140.01416.39
7.2.40.0160.00617.02
7.2.30.0140.00716.84
7.2.20.0170.01016.36
7.2.10.0530.00817.37
7.2.00.0280.01117.55
7.1.250.0130.00715.16
7.1.200.0030.00915.79
7.1.130.0410.01016.91
7.1.120.0270.00916.76
7.1.110.0270.01116.22
7.1.100.0420.00516.05
7.1.90.0510.01116.18
7.1.80.0350.00915.96
7.1.70.0410.00615.51
7.1.60.0580.00933.09
7.1.50.0520.00533.03
7.1.40.0530.00932.61
7.1.30.0870.01332.61
7.1.20.0680.01132.68
7.1.10.0710.01114.68
7.1.00.0420.00814.75

preferences:
42.98 ms | 401 KiB | 5 Q