3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class A { } class B extends A { } class C extends B { } class TestA { public function x(C $c):A { return new C(); } } class TestB extends TestA { public function x(B $b):B { return new C(); } } class TestC extends TestB { public function x(A $a): C { return new C(); } } $c = new C(); $testA = new TestA(); $testC = new TestC(); $resultA = $testA->x($c); $resultC = $testC->x($c); var_dump([ 'TestA::x(C): expect C' => get_class($resultA), 'TestC::x(C): expect C' => get_class($resultC), ]); $a = new A(); try { $resultA = $testA->x($a); echo "impossible"; } catch (TypeError $e){ echo "TestA::x(A): expected TypeError\n"; } echo 'TestC::x(A): expect C => '. get_class($testC->x($a));

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.10.0090.01020.47
8.5.00.0110.01220.32
8.4.150.0020.00014.05
8.4.140.0130.01017.86
8.4.130.0090.01018.02
8.4.120.0090.00720.52
8.4.110.0070.00318.79
8.4.100.0140.00619.05
8.4.90.0100.01020.61
8.4.80.0050.00318.73
8.4.70.0130.00318.90
8.4.60.0090.00718.64
8.4.50.0120.00918.64
8.4.40.0100.01018.14
8.4.30.0100.01020.39
8.4.20.0100.01017.79
8.4.10.0000.00923.78
8.3.280.0030.00014.05
8.3.270.0130.00916.78
8.3.260.0080.01016.88
8.3.250.0060.00218.98
8.3.240.0060.00316.71
8.3.230.0040.00516.77
8.3.220.0100.00618.87
8.3.210.0100.00618.51
8.3.200.0040.00416.90
8.3.190.0110.00817.20
8.3.180.0110.00918.81
8.3.170.0090.00616.82
8.3.160.0070.01117.27
8.3.150.0070.01117.26
8.3.140.0090.00020.82
8.3.130.0000.00816.87
8.3.120.0030.00518.86
8.3.110.0040.00420.94
8.3.100.0040.00424.06
8.3.90.0090.00626.77
8.3.80.0080.00416.63
8.3.70.0140.00316.58
8.3.60.0040.01116.50
8.3.50.0110.00420.25
8.3.40.0070.01320.09
8.3.30.0070.00719.17
8.3.20.0070.00024.18
8.3.10.0080.00024.66
8.3.00.0050.00326.16
8.2.290.0110.00420.62
8.2.280.0120.00818.74
8.2.270.0100.01017.07
8.2.260.0060.01216.93
8.2.250.0080.00018.46
8.2.240.0030.01319.02
8.2.230.0040.00422.58
8.2.220.0060.00637.54
8.2.210.0090.00626.77
8.2.200.0060.00316.63
8.2.190.0000.01916.75
8.2.180.0160.00325.92
8.2.170.0070.00719.13
8.2.160.0150.00022.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0100.00026.16
8.2.120.0060.00319.64
8.2.110.0100.00719.33
8.2.100.0080.00417.97
8.2.90.0080.00017.88
8.2.80.0000.00818.96
8.2.70.0040.00417.63
8.2.60.0040.00417.63
8.2.50.0000.00817.98
8.2.40.0080.00018.22
8.2.30.0070.00018.16
8.2.20.0040.00420.46
8.2.10.0040.00418.14
8.2.00.0040.00419.31
8.1.330.0120.00618.00
8.1.320.0120.00816.01
8.1.310.0110.00717.95
8.1.300.0120.00418.71
8.1.290.0070.00430.84
8.1.280.0030.01025.92
8.1.270.0070.01123.99
8.1.260.0090.00026.35
8.1.250.0080.00028.09
8.1.240.0070.00419.13
8.1.230.0080.00420.86
8.1.220.0000.00818.58
8.1.210.0030.00618.77
8.1.200.0030.00617.35
8.1.190.0000.00817.38
8.1.180.0060.00318.10
8.1.170.0040.00417.62
8.1.160.0030.00520.62
8.1.150.0040.00418.61
8.1.140.0080.00017.38
8.1.130.0000.00718.78
8.1.120.0040.00417.48
8.1.110.0000.00717.36
8.1.100.0030.00317.42
8.1.90.0000.00717.47
8.1.80.0060.00317.44
8.1.70.0040.00417.44
8.1.60.0110.00417.39
8.1.50.0070.00717.17
8.1.40.0100.00316.98
8.1.30.0100.00517.26
8.1.20.0060.00517.58
8.1.10.0070.00317.13
8.1.00.0030.00717.50
8.0.300.0000.00918.77
8.0.290.0040.00416.75
8.0.280.0030.00318.47
8.0.270.0000.00716.91
8.0.260.0040.00418.45
8.0.250.0000.00817.05
8.0.240.0040.00417.06
8.0.230.0000.00716.93
8.0.220.0030.00317.04
8.0.210.0030.00316.94
8.0.200.0000.00716.96
8.0.190.0080.00016.98
8.0.180.0050.00516.87
8.0.170.0030.00616.93
8.0.160.0000.01016.84
8.0.150.0040.00816.09
8.0.140.0100.00016.33
8.0.130.0000.01016.65
8.0.120.0090.00316.30
8.0.110.0110.00316.39
8.0.100.0050.00516.35
8.0.90.0100.00316.78
8.0.80.0110.00416.47
8.0.70.0050.01016.34
8.0.60.0000.01516.47
8.0.50.0100.01016.73
8.0.30.0110.01116.79
8.0.20.0130.00016.27
8.0.10.0050.00616.72
7.4.330.0000.00515.55
7.4.320.0060.00016.55
7.4.300.0030.00316.53
7.4.290.0090.00316.19
7.4.280.0110.00516.25
7.4.270.0090.00416.16
7.4.260.0080.00516.42
7.4.250.0100.00516.22
7.4.240.0070.00716.38
7.4.230.0030.00916.23
7.4.220.0110.00016.15
7.4.210.0060.00616.24
7.4.200.0080.00816.35
7.4.190.0000.01115.92
7.4.180.0070.00615.90
7.4.160.0130.00015.96
7.4.150.0080.00415.90
7.4.140.0110.00015.65
7.4.130.0080.00315.63
7.4.120.0080.00415.72
7.4.110.0100.00516.40
7.4.100.0100.00315.97
7.4.90.0040.00816.29
7.4.80.0040.00915.95
7.4.70.0130.00016.18
7.4.60.0040.00916.12
7.4.50.0000.01415.98
7.4.40.0000.01015.88
7.4.30.0030.00316.00
7.4.20.0030.00615.91
7.4.10.0000.00816.46
7.4.00.0040.00316.38

preferences:
135.69 ms | 403 KiB | 5 Q