3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Adder { function calculate(int $x, int $y) { return $x + $y; } } trait Subtractor { function calculate(int $x, int $y) { return $x - $y; } } class StupidCalc { use Adder { calculate as add; } use Subtractor { calculate as sub; } function maybeAdd(int $x, int $y) { return add($x, $y); } function maybeSub(int $x, int $y) { return sub($x, $y); } } $calc = new StupidCalc(); echo $calc->maybeAdd(3, 2); echo $calc->maybeSub(3, 2);

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.0170.00716.75
8.3.50.0060.00816.33
8.3.40.0140.00718.71
8.3.30.0060.01318.64
8.3.20.0060.00320.04
8.3.10.0080.00023.70
8.3.00.0100.00717.59
8.2.180.0140.00716.61
8.2.170.0100.00322.96
8.2.160.0080.00520.39
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00819.02
8.2.120.0040.00426.35
8.2.110.0000.01120.39
8.2.100.0070.00417.84
8.2.90.0000.00819.05
8.2.80.0000.00817.97
8.2.70.0100.00017.50
8.2.60.0040.00417.80
8.2.50.0060.00319.66
8.2.40.0040.00422.19
8.2.30.0000.00719.19
8.2.20.0040.00417.92
8.2.10.0070.00018.00
8.2.00.0040.00417.90
8.1.280.0070.00725.92
8.1.270.0000.00723.90
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00623.84
8.1.230.0070.00717.42
8.1.220.0060.00317.76
8.1.210.0000.00818.77
8.1.200.0060.00317.23
8.1.190.0080.00317.25
8.1.180.0050.00318.10
8.1.170.0000.00818.70
8.1.160.0000.00718.93
8.1.150.0040.00420.65
8.1.140.0000.00719.42
8.1.130.0080.00018.73
8.1.120.0000.00717.29
8.1.110.0030.00717.43
8.1.100.0070.00017.44
8.1.90.0080.00017.28
8.1.80.0000.00717.32
8.1.70.0000.00717.27
8.1.60.0050.00317.41
8.1.50.0050.00317.35
8.1.40.0000.00817.44
8.1.30.0000.00817.60
8.1.20.0000.00817.52
8.1.10.0000.00817.42
8.1.00.0000.00717.32
8.0.300.0080.00018.77
8.0.290.0000.00716.58
8.0.280.0030.00318.39
8.0.270.0050.00317.18
8.0.260.0030.00316.85
8.0.250.0070.00016.96
8.0.240.0030.00316.88
8.0.230.0070.00316.86
8.0.220.0080.00016.88
8.0.210.0000.00716.79
8.0.200.0030.00316.93
8.0.190.0050.00316.85
8.0.180.0040.00416.93
8.0.170.0070.00016.86
8.0.160.0040.00416.94
8.0.150.0040.00416.79
8.0.140.0040.00416.87
8.0.130.0030.00313.28
8.0.120.0000.00816.86
8.0.110.0000.00816.93
8.0.100.0050.00316.79
8.0.90.0040.00416.95
8.0.80.0140.01116.84
8.0.70.0040.00416.93
8.0.60.0050.00216.79
8.0.50.0000.00916.78
8.0.30.0080.01017.01
8.0.20.0080.01017.40
8.0.10.0070.00017.07
8.0.00.0130.01016.68
7.4.330.0000.00615.55
7.4.320.0000.00616.42
7.4.300.0000.00616.52
7.4.290.0060.00316.30
7.4.280.0000.00816.57
7.4.270.0000.00716.48
7.4.260.0030.00313.16
7.4.250.0040.00416.45
7.4.240.0000.00816.51
7.4.230.0030.00316.53
7.4.220.0150.00316.48
7.4.210.0170.00416.51
7.4.200.0030.00316.56
7.4.160.0080.01116.37
7.4.150.0030.01817.40
7.4.140.0050.01317.86
7.4.130.0120.01216.52
7.4.120.0110.01216.43
7.4.110.0060.01016.37
7.4.100.0060.01216.50
7.4.90.0140.00316.57
7.4.80.0140.00719.39
7.4.70.0160.00416.37
7.4.60.0150.00616.54
7.4.50.0060.00916.33
7.4.40.0130.00316.29
7.4.30.0060.01016.73
7.4.00.0110.00514.94
7.3.330.0000.00613.23
7.3.320.0060.00013.11
7.3.310.0030.00316.27
7.3.300.0060.00016.16
7.3.290.0030.00316.29
7.3.280.0060.01116.22
7.3.270.0040.01317.40
7.3.260.0080.00916.26
7.3.250.0060.01316.27
7.3.240.0090.00916.41
7.3.230.0070.01016.55
7.3.210.0080.00816.25
7.3.200.0090.00616.27
7.3.190.0060.01616.45
7.3.180.0150.00416.34
7.3.170.0090.00616.34
7.3.160.0110.00416.24
7.3.120.0080.00814.64
7.3.110.0070.01014.57
7.3.100.0080.00814.54
7.3.90.0030.00614.75
7.3.80.0000.01614.93
7.3.70.0100.00314.75
7.3.60.0060.00614.70
7.3.50.0070.01014.87
7.3.40.0030.00614.77
7.3.30.0090.00614.63
7.3.20.0120.00016.27
7.3.10.0030.01016.76
7.3.00.0060.00816.63
7.2.330.0140.00716.29
7.2.320.0060.01016.65
7.2.310.0030.01716.45
7.2.300.0080.00816.51
7.2.290.0080.00816.44
7.2.250.0070.01014.83
7.2.240.0070.01114.99
7.2.230.0000.01414.61
7.2.220.0000.00915.07
7.2.210.0000.01315.07
7.2.200.0080.00314.93
7.2.190.0070.01014.93
7.2.180.0160.00014.89
7.2.170.0060.00315.02
7.2.130.0130.00016.93
7.2.120.0150.00216.57
7.2.110.0090.01116.40
7.2.100.0160.00516.55
7.2.90.0280.00815.93
7.2.80.0140.00516.00
7.2.70.0180.00816.18
7.2.60.0160.00515.99
7.2.50.0270.00516.01
7.2.40.0140.00515.95
7.2.30.0110.00616.13
7.2.20.0210.00515.95
7.2.10.0180.00715.91
7.2.00.0090.00916.12
7.1.330.0030.00915.47
7.1.320.0000.01715.67
7.1.310.0040.00815.52
7.1.300.0060.00915.45
7.1.290.0030.01415.41
7.1.280.0030.00715.25
7.1.270.0050.00515.72
7.1.260.0030.00615.64
7.1.250.0070.00715.60
7.1.240.0250.00315.61
7.1.230.0120.00915.71
7.1.220.0140.00715.49
7.1.210.0200.00314.71
7.1.200.0130.00614.57
7.1.190.0310.00614.67
7.1.180.0420.00814.73
7.1.170.0100.00514.76
7.1.160.0070.01114.46
7.1.150.0120.00214.74
7.1.140.0080.00814.69
7.1.130.0350.00714.60
7.1.120.0230.00514.71
7.1.110.0150.00714.85
7.1.100.0180.00714.68
7.1.90.0100.00714.65
7.1.80.0150.00614.78
7.1.70.0080.01214.78
7.1.60.0600.00323.71
7.1.50.0690.00723.72
7.1.40.0280.00523.76
7.1.30.0300.00523.80
7.1.20.0190.00823.80
7.1.10.0310.00514.63
7.1.00.0180.00014.59
7.0.320.0290.00315.30
7.0.310.0310.00714.44
7.0.300.0150.00314.37
7.0.290.0200.00614.27
7.0.280.0250.00814.31
7.0.270.0060.00914.29
7.0.260.0090.00714.22
7.0.250.0370.00314.54
7.0.240.0150.00614.46
7.0.230.0380.00514.28
7.0.220.0290.00614.30
7.0.210.0370.00514.38
7.0.200.0610.00614.39
7.0.190.0290.00614.49
7.0.180.0180.00414.35
7.0.170.0130.00714.38
7.0.160.0800.00214.47
7.0.150.0120.00614.22
7.0.140.0310.00614.27
7.0.130.0150.00314.43
7.0.120.0130.00814.51
7.0.110.0120.00614.36
7.0.100.0170.00414.14
7.0.90.0590.00514.31
7.0.80.0110.00614.34
7.0.70.0440.00214.31
7.0.60.0150.00414.41
7.0.50.0080.01014.46
7.0.40.0240.00813.29
7.0.30.0330.00813.40
7.0.20.0670.00313.33
7.0.10.0110.00613.27
7.0.00.0070.00713.44
5.6.380.0030.01314.09

preferences:
53.09 ms | 401 KiB | 5 Q