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 public add; } use Subtractor { calculate as public sub; } function maybeAdd(int $x, int $y) { return $this->add($x, $y); } function maybeSub(int $x, int $y) { return $this->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.0040.01116.88
8.3.50.0110.00416.49
8.3.40.0090.00618.63
8.3.30.0070.00718.71
8.3.20.0040.00420.29
8.3.10.0070.00021.71
8.3.00.0050.00317.59
8.2.180.0110.00618.16
8.2.170.0110.00422.96
8.2.160.0000.01520.52
8.2.150.0000.00824.18
8.2.140.0030.00524.66
8.2.130.0080.00021.12
8.2.120.0000.00726.35
8.2.110.0040.00420.52
8.2.100.0090.00317.84
8.2.90.0000.00919.22
8.2.80.0080.00017.97
8.2.70.0060.00617.50
8.2.60.0000.00817.80
8.2.50.0040.00418.10
8.2.40.0000.00922.15
8.2.30.0040.00419.19
8.2.20.0040.00418.04
8.2.10.0000.00717.92
8.2.00.0040.00417.88
8.1.280.0070.00725.92
8.1.270.0080.00023.88
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0100.00022.14
8.1.230.0080.00417.42
8.1.220.0080.00317.74
8.1.210.0000.00818.77
8.1.200.0060.00317.23
8.1.190.0040.00816.88
8.1.180.0080.00018.10
8.1.170.0030.00518.46
8.1.160.0000.00718.87
8.1.150.0000.00720.61
8.1.140.0040.00419.50
8.1.130.0070.00318.78
8.1.120.0030.00317.43
8.1.110.0090.00017.23
8.1.100.0040.00417.33
8.1.90.0040.00417.39
8.1.80.0070.00017.38
8.1.70.0030.00317.41
8.1.60.0030.00517.40
8.1.50.0020.00517.46
8.1.40.0000.00817.44
8.1.30.0000.00717.48
8.1.20.0040.00417.59
8.1.10.0000.00717.43
8.1.00.0080.00017.32
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0080.00018.39
8.0.270.0040.00417.18
8.0.260.0000.00816.69
8.0.250.0050.00216.97
8.0.240.0030.00316.92
8.0.230.0060.00316.83
8.0.220.0000.00716.77
8.0.210.0000.00816.86
8.0.200.0050.00316.86
8.0.190.0030.00516.98
8.0.180.0040.00816.91
8.0.170.0040.00416.95
8.0.160.0000.00716.84
8.0.150.0000.00716.71
8.0.140.0000.00716.86
8.0.130.0050.00313.34
8.0.120.0040.00416.71
8.0.110.0030.00316.71
8.0.100.0000.00716.68
8.0.90.0000.00716.91
8.0.80.0070.01016.88
8.0.70.0040.00416.91
8.0.60.0040.00416.76
8.0.50.0040.00416.73
8.0.30.0100.00616.95
8.0.20.0080.01017.40
8.0.10.0030.00516.96
8.0.00.0150.00416.52
7.4.330.0000.00515.55
7.4.320.0000.00616.36
7.4.300.0000.00716.45
7.4.290.0000.00816.43
7.4.280.0040.00416.54
7.4.270.0000.00716.36
7.4.260.0030.00313.21
7.4.250.0040.00316.41
7.4.240.0000.00716.45
7.4.230.0040.00416.34
7.4.220.0100.01616.34
7.4.210.0150.00516.45
7.4.200.0000.00716.45
7.4.160.0030.01316.42
7.4.150.0040.02017.40
7.4.140.0080.01117.86
7.4.130.0060.01416.63
7.4.120.0120.00716.46
7.4.110.0030.01316.27
7.4.100.0150.00616.57
7.4.90.0100.00716.48
7.4.80.0100.01419.39
7.4.70.0100.00716.38
7.4.60.0070.01016.38
7.4.50.0030.01216.27
7.4.40.0060.01116.47
7.4.30.0160.00616.51
7.4.00.0000.01514.79
7.3.330.0050.00013.24
7.3.320.0000.00513.21
7.3.310.0000.00616.13
7.3.300.0000.00716.20
7.3.290.0030.00316.15
7.3.280.0070.01016.22
7.3.270.0130.00617.40
7.3.260.0090.00716.28
7.3.250.0090.01016.31
7.3.240.0070.01016.40
7.3.230.0080.01216.43
7.3.210.0100.00716.19
7.3.200.0090.00916.33
7.3.190.0100.00616.42
7.3.180.0140.00316.49
7.3.170.0080.00816.33
7.3.160.0150.00516.37
7.3.10.0070.01016.55
7.3.00.0080.00816.65
7.2.330.0250.02216.31
7.2.320.0110.00516.51
7.2.310.0130.01016.48
7.2.300.0130.00716.48
7.2.290.0140.00416.31
7.2.130.0110.01116.31
7.2.120.0100.01016.31
7.2.110.0140.00416.66
7.2.100.0160.00416.40
7.2.90.0280.00615.70
7.2.80.0210.00715.72
7.2.70.1750.00915.64
7.2.60.0140.01015.72
7.2.50.0110.00815.89
7.2.40.0110.00815.73
7.2.30.0280.00715.62
7.2.20.0130.00515.63
7.2.10.0560.01015.60
7.2.00.0090.01115.74
7.1.250.0060.00615.21
7.1.210.0350.01313.52
7.1.200.0120.00413.50
7.1.190.0490.00913.50
7.1.180.0030.01713.72
7.1.170.0110.01113.71
7.1.160.1940.00413.70
7.1.150.0070.00813.66
7.1.140.1570.00313.84
7.1.130.3060.00313.64
7.1.120.0120.00613.67
7.1.110.5480.01013.71
7.1.100.0110.00813.96
7.1.90.1980.00413.55
7.1.80.0090.00613.55
7.1.70.1170.01613.56
7.1.60.0740.00931.49
7.1.50.0320.00431.68
7.1.40.0230.00831.45
7.1.30.0690.00931.68
7.1.20.0210.01531.84
7.1.10.0030.01013.55
7.1.00.0060.01213.73
7.0.310.0120.00313.27
7.0.300.0040.00913.28
7.0.290.0670.00413.37
7.0.280.0320.00613.54
7.0.270.1280.01013.08
7.0.260.0100.00713.25
7.0.250.1420.01313.34
7.0.240.0820.01113.10
7.0.230.0450.00313.51
7.0.220.0070.01013.47
7.0.210.0400.00313.07
7.0.200.0120.00313.02
7.0.190.0100.00413.23
7.0.180.0110.00413.36
7.0.170.0910.00413.24
7.0.160.0140.00713.62
7.0.150.0380.00913.24
7.0.140.0410.00313.36
7.0.130.0060.00613.33
7.0.120.0250.00613.31
7.0.110.0070.00713.02
7.0.100.0090.00613.43
7.0.90.0150.00513.41
7.0.80.0290.01313.36
7.0.70.0730.00313.12
7.0.60.0120.00013.14
7.0.50.0520.00413.22
7.0.40.2610.00613.00
7.0.30.0090.00913.38
7.0.20.0070.01013.30
7.0.10.0140.00613.37
7.0.00.0180.00313.21

preferences:
40.17 ms | 401 KiB | 5 Q