3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); interface Factory { public function build(): Product; } interface Product { } class A implements Product { } class B implements Product { } class FA implements Factory { public function build(): Product { return new A; } } class FB implements Factory { public function build(): Product { return new A; } } class Client { private $f; public function __construct(Factory $f) { $this->f = $f; } public function payload() { var_dump($this->f->build()); } } $fa = new FA; $clientA = new Client($fa); $clientA->payload(); $fb = new FB; $clientB = new Client($fb); $clientB->payload();

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.120.0140.00624.08
8.4.110.0080.00218.13
8.4.100.0110.00918.89
8.4.90.0100.00219.02
8.4.80.0130.00718.88
8.4.70.0050.00318.09
8.4.60.0090.01118.61
8.4.50.0060.00218.70
8.4.40.0150.00317.80
8.4.30.0040.00418.83
8.4.20.0100.00317.80
8.4.10.0050.00519.47
8.3.250.0120.00719.09
8.3.240.0120.00717.18
8.3.230.0120.00717.23
8.3.220.0130.00619.24
8.3.210.0090.00416.63
8.3.200.0120.00816.69
8.3.190.0050.00417.18
8.3.180.0110.00717.01
8.3.170.0120.00620.94
8.3.160.0170.00318.86
8.3.150.0090.00917.16
8.3.140.0110.00016.54
8.3.130.0000.00818.47
8.3.120.0030.01320.91
8.3.110.0090.00620.94
8.3.100.0120.00324.06
8.3.90.0110.00426.77
8.3.80.0060.00319.36
8.3.70.0070.01016.58
8.3.60.0070.01118.43
8.3.50.0080.01323.70
8.3.40.0090.00922.00
8.3.30.0150.00018.64
8.3.20.0000.00824.18
8.3.10.0030.00624.66
8.3.00.0080.00026.16
8.2.290.0080.00920.40
8.2.280.0110.00418.12
8.2.270.0070.01117.41
8.2.260.0110.00816.84
8.2.250.0110.00718.50
8.2.240.0060.00318.95
8.2.230.0040.00422.58
8.2.220.0050.00537.54
8.2.210.0040.00426.77
8.2.200.0030.00618.88
8.2.190.0070.01116.58
8.2.180.0110.00325.92
8.2.170.0060.01218.85
8.2.160.0040.01122.96
8.2.150.0000.00725.66
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00026.35
8.2.110.0060.00320.33
8.2.100.0120.00017.91
8.2.90.0040.00417.75
8.2.80.0070.00318.62
8.2.70.0030.00617.63
8.2.60.0040.00417.63
8.2.50.0060.00318.05
8.2.40.0040.00418.22
8.2.30.0080.00018.13
8.2.20.0000.00718.18
8.2.10.0000.00719.18
8.2.00.0000.00719.13
8.1.330.0090.00922.03
8.1.320.0130.00516.39
8.1.310.0070.01116.20
8.1.300.0130.00618.62
8.1.290.0060.00330.84
8.1.280.0140.00325.92
8.1.270.0040.00423.99
8.1.260.0050.00228.09
8.1.250.0080.00028.09
8.1.240.0090.00018.93
8.1.230.0000.01020.96
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0040.00417.48
8.1.190.0030.00617.48
8.1.180.0040.00418.10
8.1.170.0050.00218.60
8.1.160.0040.00418.84
8.1.150.0030.00618.91
8.1.140.0030.00518.89
8.1.130.0000.00720.15
8.1.120.0000.00817.51
8.1.110.0030.00617.46
8.1.100.0030.00517.43
8.1.90.0030.00617.45
8.1.80.0070.00017.44
8.1.70.0080.00017.48
8.1.60.0030.00617.54
8.1.50.0040.00417.56
8.1.40.0000.00817.48
8.1.30.0000.00717.68
8.1.20.0040.00417.61
8.1.10.0090.00317.54
8.1.00.0080.00017.47
8.0.300.0070.00618.77
8.0.290.0080.00016.75
8.0.280.0030.00318.52
8.0.270.0000.00818.08
8.0.260.0030.00318.46
8.0.250.0040.00417.06
8.0.240.0040.00416.96
8.0.230.0070.00017.09
8.0.220.0070.00016.99
8.0.210.0000.00816.87
8.0.200.0070.00017.03
8.0.190.0040.00416.92
8.0.180.0000.00716.96
8.0.170.0000.00817.00
8.0.160.0000.00716.97
8.0.150.0000.00716.91
8.0.140.0030.00616.82
8.0.130.0050.00013.36
8.0.120.0000.00716.86
8.0.110.0000.00716.95
8.0.100.0050.00216.79
8.0.90.0000.00716.95
8.0.80.0010.01316.99
8.0.70.0040.00416.95
8.0.60.0000.00716.96
8.0.50.0060.00316.83
8.0.30.0170.00917.28
8.0.20.0080.01117.13
8.0.10.0050.00216.90
8.0.00.0080.01016.75
7.4.330.0040.00015.55
7.4.320.0050.00316.47
7.4.300.0030.00316.66
7.4.290.0050.00316.38
7.4.280.0040.00416.61
7.4.270.0030.00316.59
7.4.260.0000.00513.25
7.4.250.0030.00316.43
7.4.240.0000.00716.63
7.4.230.0030.00316.49
7.4.220.0020.00516.66
7.4.210.0100.00416.55
7.4.200.0070.00016.32
7.4.130.0090.00916.64
7.4.120.0080.01216.48
7.4.110.0130.00816.57
7.4.100.0070.01416.71
7.4.90.0110.00716.57
7.4.80.0150.00816.64
7.4.70.0180.00316.34
7.4.60.0170.00016.02
7.4.50.0110.01116.30
7.4.40.0120.00616.30
7.4.30.0140.00416.50
7.4.20.0120.00616.38
7.4.10.0120.00616.51
7.4.00.0160.00316.63
7.3.330.0030.00716.32
7.3.320.0000.00713.27
7.3.310.0020.00516.27
7.3.300.0030.00316.14
7.3.290.0080.00916.28
7.3.260.0120.00616.34
7.3.250.0120.00816.31
7.3.240.0160.00016.39
7.3.230.0090.01216.42
7.3.220.0140.00316.57
7.3.210.0090.00916.16
7.3.200.0130.01016.45
7.3.190.0130.00516.35
7.3.180.0120.00916.46
7.3.170.0160.00616.34
7.3.160.0110.00616.13
7.3.150.0110.00616.53
7.3.140.0090.00916.23
7.3.130.0070.01116.39
7.3.120.0060.01716.37
7.3.110.0150.00816.50
7.3.100.0060.00916.19
7.3.90.0100.01016.38
7.3.80.0050.01116.28
7.3.70.0090.00916.35
7.3.60.0070.01116.32
7.3.50.0080.01116.30
7.3.40.0120.00616.20
7.3.30.0150.00516.37
7.3.20.0120.00616.39
7.3.10.0160.00316.40
7.3.00.0090.01516.38

preferences:
27.98 ms | 403 KiB | 5 Q