3v4l.org

run code in 300+ PHP versions simultaneously
<?php $operations = [ '+' => "add", '-' => "subtract" ]; // The numbers $n1 = 6; $n2 = 3; // Your operation $op = "+"; switch($operations[$op]) { case "add": // add the nos echo $n1 + $n2; break; case "subtract": // subtract the nos echo $n1 - $n2; break; default: // we can't handle other operators throw new RuntimeException(); break; }

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.70.0140.00716.58
8.3.60.0120.00618.30
8.3.50.0100.01016.40
8.3.40.0070.01118.59
8.3.30.0120.00618.60
8.3.20.0040.00421.90
8.3.10.0000.00821.88
8.3.00.0090.00019.08
8.2.190.0090.00916.58
8.2.180.0070.01425.92
8.2.170.0070.01418.96
8.2.160.0140.00322.96
8.2.150.0100.00325.66
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0040.00420.93
8.2.110.0070.00322.20
8.2.100.0040.00817.91
8.2.90.0040.00419.20
8.2.80.0030.00517.97
8.2.70.0030.00717.63
8.2.60.0110.00017.91
8.2.50.0040.00418.10
8.2.40.0000.00820.60
8.2.30.0070.00019.23
8.2.20.0000.00718.00
8.2.10.0070.00017.92
8.2.00.0030.00618.01
8.1.280.0110.00725.92
8.1.270.0070.00024.66
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0070.00421.06
8.1.230.0070.00417.70
8.1.220.0040.00417.74
8.1.210.0070.00418.77
8.1.200.0060.00317.35
8.1.190.0030.00617.22
8.1.180.0030.00618.10
8.1.170.0060.00318.38
8.1.160.0000.00718.73
8.1.150.0000.00718.82
8.1.140.0000.00719.52
8.1.130.0030.00318.74
8.1.120.0040.00417.38
8.1.110.0020.00517.27
8.1.100.0030.00517.36
8.1.90.0030.00617.39
8.1.80.0000.00917.38
8.1.70.0030.00317.39
8.1.60.0050.00317.56
8.1.50.0040.00417.45
8.1.40.0040.00417.51
8.1.30.0050.00217.58
8.1.20.0050.00317.57
8.1.10.0000.00717.59
8.1.00.0000.00817.36
8.0.300.0060.00318.77
8.0.290.0000.00716.75
8.0.280.0000.00718.29
8.0.270.0070.00017.30
8.0.260.0080.00018.61
8.0.250.0030.00317.00
8.0.240.0040.00416.79
8.0.230.0030.00616.86
8.0.220.0000.01016.88
8.0.210.0000.00716.70
8.0.200.0000.00716.93
8.0.190.0040.00416.78
8.0.180.0030.00316.87
8.0.170.0030.00716.91
8.0.160.0040.00416.90
8.0.150.0040.00416.72
8.0.140.0080.00016.68
8.0.130.0050.00013.29
8.0.120.0040.00416.70
8.0.110.0050.00316.72
8.0.100.0000.00816.65
8.0.90.0040.00416.87
8.0.80.0110.00416.71
8.0.70.0070.00016.68
8.0.60.0070.00016.85
8.0.50.0040.00416.69
8.0.30.0120.00616.84
8.0.20.0070.01217.40
8.0.10.0000.00716.82
8.0.00.0060.01216.90
7.4.330.0000.00615.55
7.4.320.0060.00016.43
7.4.300.0000.00616.42
7.4.290.0030.00516.55
7.4.280.0040.00416.41
7.4.270.0030.00316.44
7.4.260.0070.00013.16
7.4.250.0000.00716.39
7.4.240.0040.00416.46
7.4.230.0070.00016.33
7.4.220.0090.00916.41
7.4.210.0040.01116.42
7.4.200.0030.00316.29
7.4.160.0090.00916.46
7.4.150.0110.01117.40
7.4.140.0110.01217.86
7.4.130.0100.01016.55
7.4.120.0100.00716.49
7.4.110.0130.00316.34
7.4.100.0070.01016.38
7.4.90.0100.00716.68
7.4.80.0100.00719.39
7.4.70.0180.00016.48
7.4.60.0100.00716.58
7.4.50.0120.00616.52
7.4.40.0130.00416.34
7.4.30.0080.00816.49
7.4.00.0040.01115.11
7.3.330.0060.00013.18
7.3.320.0000.00513.07
7.3.310.0040.00416.11
7.3.300.0000.00716.29
7.3.290.0090.00916.31
7.3.280.0060.00916.25
7.3.270.0120.00617.40
7.3.260.0140.00316.28
7.3.250.0090.01016.48
7.3.240.0140.00716.42
7.3.230.0100.01316.42
7.3.210.0060.01216.33
7.3.200.0090.01216.67
7.3.190.0080.00916.62
7.3.180.0100.00716.64
7.3.170.0100.01016.43
7.3.160.0120.00316.14
7.2.330.0100.00716.67
7.2.320.0050.01216.43
7.2.310.0060.01016.85
7.2.300.0100.00716.35
7.2.290.0080.00816.30
7.2.60.0090.00316.56
7.2.50.0100.00316.87
7.1.200.0090.00315.70
7.1.70.0020.00716.95
7.1.60.0630.03033.13
7.1.50.0270.01733.01
7.1.40.0770.01332.48
7.1.30.0730.01332.62
7.1.20.0400.01732.69
7.1.10.0930.00714.53
7.1.00.0830.01714.72
7.0.200.0730.00714.85
7.0.190.0100.01014.89
7.0.180.0700.01314.45
7.0.170.1430.01714.30
7.0.160.0770.01314.28
7.0.150.0630.01714.50
7.0.140.0370.00314.66
7.0.130.0600.01014.61
7.0.120.0030.01714.77
7.0.110.0100.01014.68
7.0.100.0770.01714.40
7.0.90.0070.01314.25
7.0.80.0000.01314.42
7.0.70.0800.01314.57
7.0.60.0100.01314.27
7.0.50.0370.01714.63
7.0.40.0930.01714.76
7.0.30.0700.01714.75
7.0.20.0070.01014.57
7.0.10.0170.00314.45
7.0.00.0670.01314.56

preferences:
40.78 ms | 401 KiB | 5 Q