3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface HasMethodReturnIntOrString { public function methodA(): int|string; } interface HasMethodReturnIntOrFloat { public function methodA(): int|float; } /** * 返り値が int|string 型であるメソッド methodA の実装を約束するインターフェイスと * 返り値が int|float 型であるメソッド methodA の実装を約束するインターフェイスの * 両方を実装するクラス */ class HasMethodReturnInt implements HasMethodReturnIntOrString, HasMethodReturnIntOrFloat { /** * 返り値が int|string 型 と int|float 型の両方を満たすメソッド * つまり (int|string) & (int|float) の計算結果である int 型の値を返すメソッド * @return int */ public function methodA(): int { return 0; } // 片方の型を満たせない場合↓の様にPHPがエラーを出力します // Fatal error: Declaration of HasMethodReturnInt::methodA(): string must be compatible with HasMethodReturnStringOrFloat::methodA(): int|float in ***\tmp.php on line 28 // public function methodA(): string|int // { // return 0; // } }

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.4.20.0060.01317.91
8.4.10.0040.00422.20
8.3.150.0030.00616.61
8.3.140.0030.00517.32
8.3.130.0030.00518.14
8.3.120.0000.00820.64
8.3.110.0040.00416.50
8.3.100.0060.00316.32
8.3.90.0000.01526.77
8.3.80.0070.00316.50
8.3.70.0110.00816.63
8.3.60.0070.01416.50
8.3.50.0100.01019.94
8.3.40.0120.00318.53
8.3.30.0100.00719.05
8.3.20.0000.00824.18
8.3.10.0090.00024.66
8.3.00.0040.00426.16
8.2.260.0100.00718.72
8.2.250.0040.00416.34
8.2.240.0030.00616.93
8.2.230.0000.00820.94
8.2.220.0040.00424.06
8.2.210.0040.01526.77
8.2.200.0090.00016.63
8.2.190.0130.00716.58
8.2.180.0160.00325.92
8.2.170.0000.01418.86
8.2.160.0100.00322.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0000.01826.16
8.2.120.0070.00020.65
8.2.110.0090.00022.25
8.2.100.0080.00417.72
8.2.90.0080.00017.88
8.2.80.0090.00017.97
8.2.70.0100.00317.50
8.2.60.0060.00317.90
8.2.50.0040.00418.07
8.2.40.0000.00918.11
8.2.30.0060.00318.00
8.2.20.0050.00220.48
8.2.10.0070.00017.93
8.2.00.0000.00719.09
8.1.310.0090.00316.61
8.1.300.0060.01319.62
8.1.290.0060.00330.84
8.1.280.0120.00325.92
8.1.270.0040.00423.99
8.1.260.0100.00026.35
8.1.250.0030.00528.09
8.1.240.0000.01120.92
8.1.230.0080.00421.04
8.1.220.0050.00317.74
8.1.210.0000.00818.97
8.1.200.0060.00317.35
8.1.190.0020.00517.11
8.1.180.0050.00518.10
8.1.170.0040.00718.57
8.1.160.0040.00418.73
8.1.150.0000.00718.54
8.1.140.0000.00817.38
8.1.130.0070.00018.77
8.1.120.0000.00817.28
8.1.110.0000.00817.29
8.1.100.0050.00317.38
8.1.90.0000.00817.39
8.1.80.0030.00617.30
8.1.70.0000.00717.28
8.1.60.0000.00817.54
8.1.50.0170.00917.42
8.1.40.0170.00317.30
8.1.30.0040.00817.45
8.1.20.0220.00417.53
8.1.10.0190.00517.33
8.1.00.0220.00017.20
8.0.300.0070.00019.98
8.0.290.0050.00316.75
8.0.280.0000.00720.18
8.0.270.0040.00417.85
8.0.260.0030.00318.24
8.0.250.0070.00016.92
8.0.240.0000.00616.71
8.0.230.0000.00716.90
8.0.220.0030.00316.71
8.0.210.0030.00316.71
8.0.200.0060.00016.77
8.0.190.0000.00716.95
8.0.180.0210.00016.68
8.0.170.0140.00716.74
8.0.160.0090.00616.88
8.0.150.0150.00616.70
8.0.140.0180.00616.67
8.0.130.0140.00816.84
8.0.120.0140.00416.79
8.0.110.0100.00716.73
8.0.100.0160.00416.73
8.0.90.0150.00016.81
8.0.80.0110.00316.66
8.0.70.0140.00616.75
8.0.60.0110.00416.80
8.0.50.0080.00816.77
8.0.30.0000.01316.63
8.0.20.0090.00616.75
8.0.10.0180.00016.86
7.4.330.0030.00315.55
7.4.320.0000.00616.46
7.4.300.0030.00316.31
7.4.290.0160.00516.46
7.4.280.0040.00416.38
7.4.270.0120.00316.34
7.4.260.0090.00616.26
7.4.250.0160.00616.43
7.4.240.0210.00616.44
7.4.230.0260.00016.36
7.4.220.0120.00816.43
7.4.210.0070.00716.32
7.4.200.0150.00016.42
7.4.190.0160.00316.49
7.4.180.0090.00416.34
7.4.160.0120.00416.30
7.4.150.0180.00016.32
7.4.140.0150.00516.28
7.4.130.0110.00416.32
7.4.120.0180.00016.29
7.4.110.0110.00716.10
7.4.100.0100.00516.23
7.4.90.0090.00516.19
7.4.80.0170.00016.26
7.4.70.0120.00416.25
7.4.60.0100.00316.18
7.4.50.0110.00416.18
7.4.40.0150.00316.03
7.4.30.0060.00616.11
7.4.20.0140.00016.29
7.4.10.0150.00316.29
7.4.00.0180.00016.26

preferences:
53.14 ms | 403 KiB | 5 Q