3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface One { function callme(string $data): void; } interface Two { function callme(int $data): void; } class OneImpl implements One { function callme(string $data): void {} } class TwoImpl implements Two { function callme(int $data): void {} } class BothImpl implements One, Two { /** * @param int|string $data */ function callme($data): void {} } /** * @param "one"|"two"|"both" $switch * @return One|Two */ function getEither(string $switch) { if ($switch === "one") { return new OneImpl(); } if ($switch === "two") { return new TwoImpl(); } return new BothImpl(); } /** * @param One|Two $impl */ function process($impl): void { if ($impl instanceof One && $impl instanceof Two) { echo 'both'; } elseif ($impl instanceof One) { echo 'one'; } elseif ($impl instanceof Two) { echo 'two'; } } process(getEither("one")); process(getEither("two")); process(getEither("both"));

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.5.70.0090.00916.46
8.5.60.0100.00716.69
8.5.50.0110.00818.45
8.5.30.0080.00619.10
8.5.20.0010.00721.32
8.5.10.0070.00216.71
8.5.00.0130.00820.06
8.4.220.0110.00922.09
8.4.210.0140.00821.46
8.4.180.0130.00825.76
8.4.170.0150.00723.97
8.4.160.0140.00823.93
8.4.150.0090.00416.85
8.4.140.0120.00917.34
8.4.130.0110.01017.69
8.4.120.0120.00820.73
8.4.110.0120.00618.84
8.4.100.0080.00417.81
8.4.90.0120.00817.66
8.4.80.0140.00522.53
8.4.70.0150.00617.70
8.4.60.0070.00820.83
8.4.50.0150.00618.89
8.4.40.0030.00619.47
8.4.30.0080.00020.24
8.4.20.0000.00818.67
8.4.10.0040.00417.82
8.3.310.0080.00218.64
8.3.300.0110.01022.85
8.3.290.0110.01018.17
8.3.280.0120.00718.50
8.3.270.0140.00616.62
8.3.260.0120.00816.38
8.3.250.0090.01018.88
8.3.240.0090.01016.79
8.3.230.0090.01116.43
8.3.220.0080.01017.15
8.3.210.0090.01016.63
8.3.200.0060.00316.70
8.3.190.0120.00617.36
8.3.180.0080.01016.55
8.3.170.0210.00018.58
8.3.160.0090.00918.98
8.3.150.0110.00717.29
8.3.140.0140.00316.54
8.3.130.0030.00616.74
8.3.120.0100.00019.02
8.3.110.0030.00620.94
8.3.100.0030.00716.49
8.3.90.0060.00616.62
8.3.80.0060.00318.30
8.3.70.0040.01518.31
8.3.60.0070.00718.43
8.3.50.0120.00518.99
8.3.40.0090.00618.77
8.3.30.0060.00918.55
8.3.20.0000.00822.48
8.3.10.0000.00821.92
8.3.00.0030.00622.39
8.2.310.0110.00819.66
8.2.300.0100.01018.12
8.2.290.0050.00820.53
8.2.280.0150.00416.55
8.2.270.0110.01117.20
8.2.260.0090.00916.90
8.2.250.0030.00518.23
8.2.240.0090.00616.31
8.2.230.0090.00922.58
8.2.220.0100.00024.06
8.2.210.0090.00626.77
8.2.200.0040.00716.63
8.2.190.0140.00316.63
8.2.180.0080.00818.41
8.2.170.0120.00322.96
8.2.160.0130.00022.08
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0050.00326.16
8.2.120.0080.00026.16
8.2.110.0080.00321.13
8.2.100.0070.00417.66
8.2.90.0050.00520.38
8.2.80.0030.00918.04
8.2.70.0000.00817.91
8.2.60.0000.00918.03
8.2.50.0030.00618.10
8.2.40.0050.00321.11
8.2.30.0040.00419.11
8.2.20.0040.00417.92
8.2.10.0000.00719.20
8.2.00.0040.00419.26
8.1.340.0120.00819.30
8.1.330.0130.00616.93
8.1.320.0130.00816.28
8.1.310.0060.00918.57
8.1.300.0090.00616.61
8.1.290.0060.00318.88
8.1.280.0070.01425.92
8.1.270.0060.00322.41
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0030.00622.38
8.1.230.0060.00620.89
8.1.220.0000.00817.74
8.1.210.0060.00318.91
8.1.200.0030.00617.35
8.1.190.0050.00317.10
8.1.180.0000.00718.10
8.1.170.0040.00420.28
8.1.160.0000.00818.96
8.1.150.0040.00418.73
8.1.140.0000.00820.34
8.1.130.0000.00720.15
8.1.120.0040.00417.44
8.1.110.0000.00817.41
8.1.100.0070.00017.37
8.1.90.0040.00417.30
8.1.80.0000.00817.40
8.1.70.0030.00317.42
8.1.60.0030.00617.53
8.1.50.0030.00517.46
8.1.40.0050.00317.43
8.1.30.0080.00017.54
8.1.20.0030.00517.46
8.1.10.0090.00017.38
8.1.00.0040.00417.46
8.0.300.0000.00819.91
8.0.290.0050.00216.75
8.0.280.0030.00318.51
8.0.270.0000.00717.27
8.0.260.0030.00320.10
8.0.250.0030.00316.96
8.0.240.0030.00316.86
8.0.230.0030.00316.91
8.0.220.0030.00316.82
8.0.210.0040.00416.91
8.0.200.0000.00816.78
8.0.190.0050.00216.91
8.0.180.0040.00416.89
8.0.170.0040.00416.85
8.0.160.0040.00416.79
8.0.150.0030.00516.65
8.0.140.0000.00716.81
8.0.130.0030.00313.25
8.0.120.0050.00316.86
8.0.110.0050.00316.82
8.0.100.0000.00716.91
8.0.90.0040.00416.83
8.0.80.0060.01316.80
8.0.70.0000.00716.88
8.0.60.0080.00016.70
8.0.50.0050.00316.84
8.0.30.0170.00716.94
8.0.20.0210.00517.03
8.0.10.0030.00516.94
8.0.00.0100.00716.77
7.4.330.0000.00516.84
7.4.320.0000.00716.37
7.4.300.0030.00316.46
7.4.290.0030.00516.30
7.4.280.0070.00016.54
7.4.270.0080.00016.54
7.4.260.0060.00013.23
7.4.250.0030.00316.52
7.4.240.0020.00516.49
7.4.230.0000.00716.58
7.4.220.0030.00316.51
7.4.210.0080.00816.51
7.4.200.0050.00316.50
7.4.130.0090.00916.36
7.4.120.0060.01416.47
7.4.110.0100.01316.55
7.4.100.0090.01616.48
7.4.90.0090.01516.46
7.4.80.0110.00719.39
7.4.70.0120.00316.50
7.4.60.0030.01316.45
7.4.50.0090.00616.50
7.4.40.0030.01316.48
7.4.00.0040.01115.07
7.3.330.0030.00316.21
7.3.320.0000.00613.20
7.3.310.0040.00416.44
7.3.300.0030.00316.16
7.3.290.0090.00716.29
7.3.280.0060.00916.32
7.3.260.0070.01016.54
7.3.240.0080.00816.49
7.3.230.0090.00916.43
7.3.210.0060.01516.45
7.3.200.0140.00416.53
7.3.190.0090.00916.70
7.3.180.0140.00316.46
7.3.170.0090.01016.61
7.3.160.0030.01316.22
7.3.100.0000.01814.75
7.3.90.0030.01014.75
7.3.80.0120.00814.74
7.3.70.0100.00714.67
7.3.60.0030.01114.75
7.3.50.0080.00814.69
7.3.40.0180.00014.90
7.3.30.0050.00914.76
7.3.20.0070.00714.80
7.3.10.0090.00614.76
7.3.00.0060.01414.77
7.2.330.0060.01216.67
7.2.320.0070.01016.73
7.2.310.0130.00816.33
7.2.300.0070.01416.77
7.2.290.0000.01616.36
7.2.230.0160.00914.63
7.2.220.0070.00714.91
7.2.210.0150.01114.71
7.2.200.0060.00914.99
7.2.190.0050.01214.73
7.2.180.0000.01614.84
7.2.170.0090.00915.12
7.2.160.0000.01514.93
7.2.150.0080.00714.86
7.2.140.0160.00014.96
7.2.130.0100.00714.92
7.2.120.0060.00915.14
7.2.110.0120.00314.90
7.2.100.0080.00615.21
7.2.90.0050.01115.01
7.2.80.0060.00915.15
7.2.70.0160.00015.17
7.2.60.0190.00614.72
7.2.50.0100.01015.23
7.2.40.0030.01714.94
7.2.30.0120.00414.79
7.2.20.0070.00715.12
7.2.10.0130.00714.90
7.2.00.0130.00615.07
7.1.320.0050.00813.99
7.1.310.0180.00013.61
7.1.300.0120.00313.82
7.1.290.0070.01113.97
7.1.280.0030.01013.50
7.1.270.0090.00613.54
7.1.260.0070.00713.81
7.1.250.0070.00713.73

preferences:
110.13 ms | 1484 KiB | 5 Q