3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A {} class B {} class C extends A {} $tests = [ 1 => [new A(), new A()], // succeeds 2 => [new A(), new B()], // fails 3 => [new C(), new C()], // succeeds ]; echo 'TEST 1:' . PHP_EOL; foreach ($tests as $index => $collection) { try { array_map(static function (A $object): void {}, $collection); } catch (\TypeError $e) { echo sprintf('Index %d failed, because it doesn\'t contain instances of A only.' . PHP_EOL, $index); } } echo PHP_EOL; echo 'TEST 2:' . PHP_EOL; foreach ($tests as $index => $collection) { try { array_map(static function (C $object): void {}, $collection); } catch (\TypeError $e) { echo sprintf('Index %d failed, because it doesn\'t contain instances of C only.' . PHP_EOL, $index); } }

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.00.0120.00920.43
8.4.150.0020.00114.05
8.4.140.0120.00917.86
8.4.130.0060.00418.16
8.4.120.0060.00320.92
8.4.110.0100.01218.76
8.4.100.0090.01117.97
8.4.90.0100.00920.39
8.4.80.0050.00919.07
8.4.70.0120.00919.03
8.4.60.0140.00720.41
8.4.50.0100.01022.65
8.4.40.0060.01319.59
8.4.30.0180.00320.33
8.4.20.0090.00918.72
8.4.10.0030.00620.65
8.3.280.0100.01018.63
8.3.270.0090.01016.61
8.3.260.0090.01016.81
8.3.250.0120.00718.72
8.3.240.0140.00516.68
8.3.230.0100.00816.69
8.3.220.0150.00319.11
8.3.210.0040.00418.46
8.3.200.0060.00316.82
8.3.190.0040.00417.29
8.3.180.0060.00416.70
8.3.170.0060.01517.17
8.3.160.0110.00718.55
8.3.150.0120.00818.56
8.3.140.0070.00717.16
8.3.130.0080.00018.64
8.3.120.0130.00319.15
8.3.110.0070.00320.94
8.3.100.0060.00316.85
8.3.90.0070.00326.77
8.3.80.0060.00316.50
8.3.70.0150.00016.58
8.3.60.0060.00918.52
8.3.50.0070.00923.71
8.3.40.0110.00418.79
8.3.30.0030.01218.85
8.3.20.0040.00424.18
8.3.10.0030.00624.66
8.3.00.0080.00026.16
8.2.290.0110.01016.78
8.2.280.0130.00618.41
8.2.270.0100.01017.16
8.2.260.0180.00016.92
8.2.250.0070.00018.68
8.2.240.0130.00617.02
8.2.230.0000.00822.58
8.2.220.0040.00424.06
8.2.210.0070.00026.77
8.2.200.0030.00718.41
8.2.190.0110.00716.63
8.2.180.0070.00725.92
8.2.170.0040.01418.96
8.2.160.0150.00022.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0070.00026.35
8.2.110.0090.00020.58
8.2.100.0030.00818.03
8.2.90.0000.00918.00
8.2.80.0000.00818.95
8.2.70.0000.00817.63
8.2.60.0000.00917.72
8.2.50.0000.00818.05
8.2.40.0030.00618.28
8.2.30.0040.00418.14
8.2.20.0050.00218.02
8.2.10.0040.00419.24
8.2.00.0000.00819.28
8.1.330.0110.00718.43
8.1.320.0120.00816.21
8.1.310.0080.01118.74
8.1.300.0060.00316.44
8.1.290.0090.00030.84
8.1.280.0120.00325.92
8.1.270.0080.00022.01
8.1.260.0040.00428.09
8.1.250.0070.00028.09
8.1.240.0100.00018.94
8.1.230.0060.00722.20
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0000.00817.23
8.1.190.0060.00317.35
8.1.180.0040.00718.10
8.1.170.0080.00018.51
8.1.160.0000.00718.81
8.1.150.0040.00418.82
8.1.140.0040.00418.96
8.1.130.0030.00317.51
8.1.120.0080.00017.51
8.1.110.0040.00417.30
8.1.100.0030.00617.47
8.1.90.0030.00517.52
8.1.80.0000.00717.42
8.1.70.0030.00317.45
8.1.60.0080.00017.63
8.1.50.0000.00817.41
8.1.40.0040.00417.52
8.1.30.0040.00417.63
8.1.20.0030.00617.68
8.1.10.0000.00717.61
8.1.00.0060.00317.50
8.0.300.0040.00418.77
8.0.290.0000.00916.88
8.0.280.0000.00720.20
8.0.270.0000.00718.14
8.0.260.0030.00316.89
8.0.250.0000.00716.99
8.0.240.0000.00816.90
8.0.230.0000.00716.97
8.0.220.0000.00816.88
8.0.210.0040.00416.93
8.0.200.0050.00217.02
8.0.190.0040.00417.07
8.0.180.0040.00416.95
8.0.170.0090.00016.84
8.0.160.0040.00416.88
8.0.150.0000.00816.79
8.0.140.0000.00716.81
8.0.130.0050.00013.43
8.0.120.0000.00816.86
8.0.110.0080.00016.87
8.0.100.0000.00916.90
8.0.90.0000.00816.85
8.0.80.0110.00816.90
8.0.70.0080.00016.91
8.0.60.0040.00416.86
8.0.50.0040.00416.93
8.0.30.0130.00516.97
8.0.20.0100.01017.01
8.0.10.0090.00917.06
8.0.00.0180.00517.01
7.4.330.0050.00015.55
7.4.320.0030.00316.53
7.4.300.0030.00316.65
7.4.290.0040.00716.65
7.4.280.0040.00416.45
7.4.270.0070.00016.38
7.4.260.0030.00313.30
7.4.250.0070.00016.53
7.4.240.0070.00016.62
7.4.230.0030.00316.55
7.4.220.0050.00216.53
7.4.210.0070.00916.66
7.4.200.0030.00616.60
7.4.160.0120.00616.60
7.4.150.0120.00616.62
7.4.140.0080.01116.47
7.4.130.0070.01016.58
7.4.120.0120.01016.44
7.4.110.0120.00716.53
7.4.100.0100.00816.66
7.4.90.0080.00816.54
7.4.80.0110.00916.44
7.4.70.0100.01316.46
7.4.60.0180.00916.52
7.4.50.0150.00916.46
7.4.40.0090.00916.49
7.4.30.0070.01316.24
7.4.20.0100.00616.37
7.4.10.0120.01116.37
7.4.00.0140.00316.62
7.3.330.0000.00716.28
7.3.320.0030.00313.38
7.3.310.0020.00516.38
7.3.300.0000.00716.38
7.3.290.0070.00916.38
7.3.280.0070.01116.36
7.3.270.0060.01216.38
7.3.260.0110.00716.49
7.3.250.0180.00616.29
7.3.240.0110.00816.31
7.3.230.0090.00716.53
7.3.220.0110.00516.39
7.3.210.0080.00916.32
7.3.200.0130.00616.43
7.3.190.0090.00916.38
7.3.180.0140.00716.36
7.3.170.0100.01016.38
7.3.160.0050.01316.45
7.3.150.0130.00516.41
7.3.140.0060.01316.40
7.3.130.0070.01316.43
7.3.120.0060.01216.49
7.3.110.0050.01216.32
7.3.100.0160.00516.36
7.3.90.0070.01016.45
7.3.80.0040.01316.29
7.3.70.0090.00816.41
7.3.60.0060.01116.46
7.3.50.0180.00416.50
7.3.40.0070.01216.42
7.3.30.0090.01016.40
7.3.20.0370.00916.42
7.3.10.0080.01416.36
7.3.00.0100.00916.42
7.2.340.0210.00816.29
7.2.330.0140.00816.46
7.2.320.0150.01016.51
7.2.310.0140.01116.41
7.2.300.0150.01216.46
7.2.290.0210.01016.51
7.2.280.0140.01016.59
7.2.270.0100.01516.36
7.2.260.0180.01216.40
7.2.250.0140.01216.50
7.2.240.0100.01616.44
7.2.230.0170.01016.59
7.2.220.0170.00616.56
7.2.210.0130.00916.41
7.2.200.0170.00816.53
7.2.190.0140.01416.56
7.2.180.0110.01416.60
7.2.170.0260.00816.55
7.2.160.0190.00716.52
7.2.150.0140.01116.61
7.2.140.0050.01216.58
7.2.130.0180.01416.68
7.2.120.0130.01216.77
7.2.110.0190.00616.66
7.2.100.0220.00916.73
7.2.90.0170.01016.55
7.2.80.0220.00416.49
7.2.70.0160.00716.68
7.2.60.0140.01016.81
7.2.50.0220.00616.52
7.2.40.0150.00716.68
7.2.30.0120.01416.65
7.2.20.0270.00616.63
7.2.10.0130.01216.62
7.2.00.0120.01016.57

preferences:
39.91 ms | 403 KiB | 5 Q