3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_morse() { return array(" " => "/ ", "a" => "*- ", "b" => "-*** ", "c" => "-*-* ", "d" => "-** ", "e" => "* ", "f" => "**-* ", "g" => "--* ", "h" => "**** ", "i" => "** ", "j" => "*--- ", "k" => "-*- ", "l" => "*-** ", "m" => "-- ", "n" => "-* ", "o" => "--- ", "p" => "*--* ", "q" => "--*- ", "r" => "*-* ", "s" => "*** ", "t" => "- ", "u" => "**- ", "v" => "***- ", "w" => "*-- ", "x" => "-** ", "y" => "-*-- ", "z" => "--** "); } function morse_encoder($word) { return str_replace(array_keys(get_morse()), get_morse(), strtolower($word)); } function morse_decoder($word) { $morse = array_map("trim", get_morse()); $output = ""; foreach (explode(" ", $word) as $value) { $output .= array_search($value, $morse); } return strtoupper($output); } echo morse_encoder("sos")."\n"; echo morse_decoder("*** --- ***");

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.130.0050.00318.40
8.3.120.0080.00418.82
8.3.110.0070.01316.62
8.3.100.0080.00024.06
8.3.90.0070.01116.76
8.3.80.0060.00318.56
8.3.70.0070.00716.63
8.3.60.0040.01116.75
8.3.50.0090.01121.20
8.3.40.0120.00318.79
8.3.30.0110.00418.70
8.3.20.0040.00420.33
8.3.10.0000.00823.57
8.3.00.0040.00421.93
8.2.250.0040.00416.90
8.2.240.0120.00318.91
8.2.230.0040.00420.94
8.2.220.0030.00637.54
8.2.210.0070.00726.77
8.2.200.0040.00418.17
8.2.190.0140.00416.58
8.2.180.0090.00616.75
8.2.170.0070.00722.96
8.2.160.0100.00719.41
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0060.00317.93
8.2.110.0090.00021.12
8.2.100.0060.00617.91
8.2.90.0000.00817.63
8.2.80.0060.00318.72
8.2.70.0000.00817.75
8.2.60.0030.00717.93
8.2.50.0060.00318.07
8.2.40.0000.00818.28
8.2.30.0040.00418.08
8.2.20.0080.00018.18
8.2.10.0020.00518.11
8.2.00.0040.00418.39
8.1.300.0090.00016.11
8.1.290.0060.00318.88
8.1.280.0090.00625.92
8.1.270.0070.00023.82
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0080.00422.19
8.1.230.0080.00320.88
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0030.00617.35
8.1.190.0060.00317.35
8.1.180.0040.00418.10
8.1.170.0040.00418.48
8.1.160.0000.00718.96
8.1.150.0000.00818.95
8.1.140.0040.00419.66
8.1.130.0070.00019.13
8.1.120.0050.00317.54
8.1.110.0060.00317.44
8.1.100.0000.00817.42
8.1.90.0050.00617.27
8.1.80.0000.00717.47
8.1.70.0070.00017.44
8.1.60.0040.00417.66
8.1.50.0060.00317.53
8.1.40.0030.00617.53
8.1.30.0040.00417.67
8.1.20.0040.00417.64
8.1.10.0000.00817.39
8.1.00.0040.00417.48
8.0.300.0030.00618.77
8.0.290.0000.00916.63
8.0.280.0000.00718.43
8.0.270.0000.00717.29
8.0.260.0030.00717.20
8.0.250.0060.00217.02
8.0.240.0030.00616.99
8.0.230.0000.00816.94
8.0.220.0030.00316.80
8.0.210.0070.00016.78
8.0.200.0030.00317.02
8.0.190.0000.00816.91
8.0.180.0040.00416.89
8.0.170.0000.00716.97
8.0.160.0040.00416.91
8.0.150.0080.00016.93
8.0.140.0040.00416.83
8.0.130.0050.00013.29
8.0.120.0050.00216.77
8.0.110.0070.00016.73
8.0.100.0040.00416.81
8.0.90.0040.00416.94
8.0.80.0060.00916.87
8.0.70.0020.00516.87
8.0.60.0050.00216.79
8.0.50.0050.00316.90
8.0.30.0070.00916.98
8.0.20.0060.01317.32
8.0.10.0070.00717.01
8.0.00.0130.00617.37
7.4.330.0030.00315.55
7.4.320.0000.00616.61
7.4.300.0000.00716.63
7.4.290.0000.00816.41
7.4.280.0050.00516.63
7.4.270.0030.00316.59
7.4.260.0000.00716.50
7.4.250.0020.00514.38
7.4.240.0000.00816.62
7.4.230.0070.00016.63
7.4.220.0060.01216.69
7.4.210.0100.01016.55
7.4.200.0000.00716.36
7.4.160.0120.00616.60
7.4.150.0060.01317.03
7.4.140.0100.01017.64
7.4.130.0120.00816.87
7.4.120.0100.00916.88
7.4.110.0090.00817.16
7.4.100.0070.01017.10
7.4.90.0100.00817.11
7.4.80.0100.00718.09
7.4.70.0080.00817.12
7.4.60.0110.00717.08
7.4.50.0110.00817.02
7.4.40.0060.01416.97
7.4.30.0090.01217.01
7.4.20.0100.00917.30
7.4.10.0050.01417.36
7.4.00.0070.01316.55
7.3.330.0000.00513.12
7.3.320.0060.00013.21
7.3.310.0000.00716.36
7.3.300.0030.00516.08
7.3.290.0070.00716.23
7.3.280.0080.01016.21
7.3.270.0110.00416.83
7.3.260.0090.00717.21
7.3.250.0070.00916.81
7.3.240.0110.00916.82
7.3.230.0100.00816.96
7.3.220.0080.00817.21
7.3.210.0070.01216.97
7.3.200.0080.01017.05
7.3.190.0080.00916.95
7.3.180.0100.00817.00
7.3.170.0090.01116.99
7.3.160.0070.01116.99
7.3.150.0130.00717.24
7.3.140.0080.01017.28
7.3.130.0110.00817.21
7.3.120.0110.01017.19
7.3.110.0110.00917.18
7.3.100.0090.01017.19
7.3.90.0080.01017.35
7.3.80.0030.01417.20
7.3.70.0080.01116.32
7.3.60.0080.01116.50
7.3.50.0050.01016.48
7.3.40.0080.00816.40
7.3.30.0080.00916.47
7.3.20.0110.01016.50
7.3.10.0060.01216.44
7.3.00.0130.00516.42
7.2.340.0170.01317.34
7.2.330.0100.01417.09
7.2.320.0170.00917.12
7.2.310.0190.00917.09
7.2.300.0190.01117.09
7.2.290.0190.01017.06
7.2.280.0150.01917.32
7.2.270.0240.01017.31
7.2.260.0240.01117.32
7.2.250.0260.01217.33
7.2.240.0250.01017.33
7.2.230.0260.00917.34
7.2.220.0250.01117.31
7.2.210.0210.01217.35
7.2.200.0160.01016.64
7.2.190.0180.01016.58
7.2.180.0150.01016.59
7.2.170.0210.00716.57
7.2.160.0130.01116.64
7.2.150.0140.01316.74
7.2.140.0250.01016.79
7.2.130.0170.00916.79
7.2.120.0220.00716.68
7.2.110.0140.01216.78
7.2.100.0180.01116.73
7.2.90.0220.00616.74
7.2.80.0240.00516.76
7.2.70.0230.00916.81
7.2.60.0170.00416.81
7.2.50.0220.00716.75
7.2.40.0190.01016.73
7.2.30.0160.01117.59
7.2.20.0190.00817.51
7.2.10.0230.01217.65
7.2.00.0310.00817.67
7.1.330.0250.00816.89
7.1.320.0310.00216.95
7.1.310.0150.01616.95
7.1.300.0360.00916.01
7.1.290.0180.00715.88
7.1.280.0190.00715.92
7.1.270.0170.00715.96
7.1.260.0150.00915.89
7.1.250.0170.00815.99
7.1.240.0190.00915.86
7.1.230.0400.01215.94
7.1.220.0230.01115.96
7.1.210.0190.00715.97
7.1.200.0170.00815.83
7.1.190.0220.00715.95
7.1.180.0160.01015.93
7.1.170.0160.01215.94
7.1.160.0220.00615.93
7.1.150.0170.01116.64
7.1.140.0140.01116.56
7.1.130.0260.00816.32
7.1.120.0250.00516.61
7.1.110.0170.01116.01
7.1.100.0190.01016.52
7.1.90.0230.00916.46
7.1.80.0210.00816.50
7.1.70.0180.00715.94
7.1.60.0220.00922.27
7.1.50.0240.01023.11
7.1.40.0240.01122.98
7.1.30.0430.02425.19
7.1.20.0570.01925.27
7.1.10.0500.02016.50
7.1.00.0560.01716.60
7.0.330.0190.00915.61
7.0.320.0200.00815.67
7.0.310.0180.01115.66
7.0.300.0200.00815.61
7.0.290.0170.01015.62
7.0.280.0220.00515.64
7.0.270.0150.00916.01
7.0.260.0200.00916.36
7.0.250.0440.00715.83
7.0.240.0180.00916.13
7.0.230.0200.00816.18
7.0.220.0200.01016.27
7.0.210.0180.01015.59
7.0.200.0230.00915.92
7.0.190.0150.01015.66
7.0.180.0150.00815.57
7.0.170.0490.02216.32
7.0.160.0410.01816.35
7.0.150.0480.01816.31
7.0.140.0520.01716.35
7.0.130.0550.02216.36
7.0.120.0430.01616.38
7.0.110.0400.01916.31
7.0.100.0530.02516.29
7.0.90.0510.02016.31
7.0.80.0490.01916.36
7.0.70.0540.01916.24
7.0.60.0670.02116.32
7.0.50.0520.01816.31
7.0.40.0540.02016.39
7.0.30.0480.02016.36
7.0.20.0370.01816.35
7.0.10.0650.01516.38
7.0.00.0420.01916.35
5.6.400.0210.00616.22
5.6.390.0210.00716.26
5.6.380.0170.00916.22
5.6.370.0160.01116.11
5.6.360.0140.01116.13
5.6.350.0180.01116.25
5.6.340.0190.00716.23
5.6.330.0190.00816.15
5.6.320.0190.00916.10
5.6.310.0200.00816.17
5.6.300.0180.03218.49
5.6.290.0140.03918.43
5.6.280.0170.03818.51
5.6.270.0140.03418.46
5.6.260.0150.03218.46
5.6.250.0130.04218.48
5.6.240.0180.03818.53
5.6.230.0130.04418.56
5.6.220.0180.03618.44
5.6.210.0190.04218.60
5.6.200.0150.04118.49
5.6.190.0160.03618.50
5.6.180.0150.04018.46
5.6.170.0150.03318.48
5.6.160.0150.04118.46
5.6.150.0180.03618.48
5.6.140.0180.03318.42
5.6.130.0160.03518.52
5.6.120.0160.03418.50
5.6.110.0150.04018.51
5.6.100.0180.04118.49
5.6.90.0170.03718.40
5.6.80.0180.03118.17
5.6.70.0150.03218.25
5.6.60.0160.03418.18
5.6.50.0140.03818.15
5.6.40.0150.04118.12
5.6.30.0140.03818.13
5.6.20.0140.03718.17
5.6.10.0140.03118.13
5.6.00.0140.03518.07
5.5.380.0170.00616.04
5.5.370.0120.00916.00
5.5.360.0150.00615.78
5.5.350.0120.01215.78
5.5.340.0230.00315.94
5.5.330.0180.00615.78
5.5.320.0150.00815.74
5.5.310.0150.00815.74
5.5.300.0100.01415.76
5.5.290.0150.00915.74
5.5.280.0200.00315.91
5.5.270.0060.01715.84
5.5.260.0170.00815.75
5.5.250.0150.00716.04
5.5.240.0130.01015.86
5.5.230.0150.01216.04
5.5.220.0180.00615.91
5.5.210.0170.00715.92
5.5.200.0160.00815.74
5.5.190.0130.00915.83
5.5.180.0110.01115.78
5.5.170.0130.00815.79
5.5.160.0140.00915.73
5.5.150.0170.01815.68
5.5.140.0180.00915.71
5.5.130.0150.01015.64
5.5.120.0170.00915.60
5.5.110.0160.01015.61
5.5.100.0140.01115.76
5.5.90.0150.00615.83
5.5.80.0130.01315.88
5.5.70.0240.00315.86
5.5.60.0160.00816.05
5.5.50.0110.01115.99
5.5.40.0190.00615.94
5.5.30.0210.00315.99
5.5.20.0210.01115.85
5.5.10.0080.01615.84
5.5.00.0150.00715.75
5.4.450.0150.00813.06
5.4.440.0150.00513.06
5.4.430.0100.00913.06
5.4.420.0070.01113.06
5.4.410.0150.00313.06
5.4.400.0230.00013.06
5.4.390.0130.00513.06
5.4.380.0150.00713.06
5.4.370.0090.00913.06
5.4.360.0120.00613.06
5.4.350.0140.00413.06
5.4.340.0100.00613.06
5.4.330.0120.00913.06
5.4.320.0150.00913.06
5.4.310.0180.00713.06
5.4.300.0150.00413.06
5.4.290.0150.00413.06
5.4.280.0080.01613.06
5.4.270.0110.00613.06
5.4.260.0070.01013.06
5.4.250.0140.00313.06
5.4.240.0140.00713.06
5.4.230.0090.00813.06
5.4.220.0160.00613.06
5.4.210.0130.00713.06
5.4.200.0150.00813.06
5.4.190.0170.00013.06
5.4.180.0090.00913.06
5.4.170.0080.00813.06
5.4.160.0100.00713.06
5.4.150.0080.00913.06
5.4.140.0050.01113.06
5.4.130.0110.00713.06
5.4.120.0100.00713.06
5.4.110.0180.00013.06
5.4.100.0120.00513.06
5.4.90.0140.00613.06
5.4.80.0130.00413.06
5.4.70.0150.00613.06
5.4.60.0100.00713.06
5.4.50.0120.00613.06
5.4.40.0070.01113.06
5.4.30.0050.01513.06
5.4.20.0080.00813.06
5.4.10.0100.01013.06
5.4.00.0130.00313.06
5.3.290.0170.00913.18
5.3.280.0120.00413.06
5.3.270.0080.00813.29
5.3.260.0140.00613.10
5.3.250.0140.00313.16
5.3.240.0080.00813.06
5.3.230.0170.00313.22
5.3.220.0180.00013.06
5.3.210.0120.00813.07
5.3.200.0110.00713.06
5.3.190.0150.00413.06
5.3.180.0170.00313.22
5.3.170.0140.00413.38
5.3.160.0180.00713.23
5.3.150.0120.00613.10
5.3.140.0140.00313.06
5.3.130.0100.00713.06
5.3.120.0090.00913.32
5.3.110.0130.00613.06
5.3.100.0100.00613.18
5.3.90.0090.00913.22
5.3.80.0150.00313.06
5.3.70.0100.00713.06
5.3.60.0160.00513.15
5.3.50.0080.01713.06
5.3.40.0040.01213.06
5.3.30.0090.00913.30
5.3.20.0120.00613.07
5.3.10.0120.00813.06
5.3.00.0160.00313.06
5.2.170.0100.00613.06
5.2.160.0040.01113.06
5.2.150.0110.00413.06
5.2.140.0130.00313.06
5.2.130.0090.00913.06
5.2.120.0130.00413.06
5.2.110.0070.01113.06
5.2.100.0110.00313.06
5.2.90.0080.00613.06
5.2.80.0090.00913.06
5.2.70.0130.00513.06
5.2.60.0090.00513.06
5.2.50.0110.00813.06
5.2.40.0120.00313.06
5.2.30.0080.00813.06
5.2.20.0070.00713.06
5.2.10.0120.00413.06
5.2.00.0120.00313.06
5.1.60.0000.01513.06
5.1.50.0080.00913.06
5.1.40.0120.00613.06
5.1.30.0080.00813.06
5.1.20.0030.01013.06
5.1.10.0100.00313.06
5.1.00.0080.00413.06
5.0.50.0070.00413.06
5.0.40.0000.01313.06
5.0.30.0070.00413.06
5.0.20.0000.01113.06
5.0.10.0070.00413.06
5.0.00.0050.00513.06
4.4.90.0000.01013.06
4.4.80.0080.00013.06
4.4.70.0070.00013.06
4.4.60.0030.00313.06
4.4.50.0070.00013.06
4.4.40.0000.00813.06
4.4.30.0060.00613.06
4.4.20.0040.00413.06
4.4.10.0040.00213.06
4.4.00.0070.00013.06
4.3.110.0040.00413.06
4.3.100.0090.00013.06
4.3.90.0000.00713.06
4.3.80.0000.00713.06
4.3.70.0040.00213.06
4.3.60.0040.00413.06
4.3.50.0060.00613.06
4.3.40.0090.00013.06
4.3.30.0040.00413.06
4.3.20.0060.00013.06
4.3.10.0030.00313.06
4.3.00.0030.00313.06

preferences:
30.85 ms | 403 KiB | 5 Q