3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface MyInterface { public function get(): int; public function set(int $value); } class Factory { private $instance = null; public function getInstance(): MyInterface { if ($this->instance === null) { $this->instance = new class() implements MyInterface { private $var; public function get(): int { return $this->var; } public function set(int $value) { $this->var = $value; } }; } return $this->instance; } } function display(MyInterface $object) { var_dump($object->get()); } $factory = new Factory(); $o = $factory->getInstance(); $o->set(5); $o2 = $factory->getInstance(); display($o2);

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.3.60.0120.00616.75
8.3.50.0180.00318.05
8.3.40.0040.01118.61
8.3.30.0060.00918.68
8.3.20.0080.00020.16
8.3.10.0080.00023.71
8.3.00.0040.00419.38
8.2.180.0150.00018.27
8.2.170.0140.00322.96
8.2.160.0110.00420.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0110.00017.61
8.2.110.0090.00322.25
8.2.100.0040.00817.93
8.2.90.0000.00819.27
8.2.80.0060.00317.97
8.2.70.0050.00317.63
8.2.60.0000.00817.93
8.2.50.0000.00918.07
8.2.40.0040.00419.44
8.2.30.0040.00420.52
8.2.20.0040.00417.58
8.2.10.0000.00818.04
8.2.00.0040.00418.05
8.1.280.0110.00325.92
8.1.270.0080.00023.84
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0050.00522.52
8.1.230.0040.00817.66
8.1.220.0030.00617.74
8.1.210.0040.00418.77
8.1.200.0080.00317.36
8.1.190.0040.00417.25
8.1.180.0000.00818.10
8.1.170.0040.00418.95
8.1.160.0040.00422.03
8.1.150.0000.00818.96
8.1.140.0050.00319.50
8.1.130.0030.00317.76
8.1.120.0050.00217.44
8.1.110.0000.00717.38
8.1.100.0000.00717.51
8.1.90.0000.00817.44
8.1.80.0070.00317.51
8.1.70.0040.00417.57
8.1.60.0000.00817.56
8.1.50.0030.00517.58
8.1.40.0090.00017.44
8.1.30.0080.00017.57
8.1.20.0090.00017.63
8.1.10.0000.00717.55
8.1.00.0030.00517.46
8.0.300.0060.00318.77
8.0.290.0080.00016.88
8.0.280.0000.00718.46
8.0.270.0000.00717.20
8.0.260.0030.00317.35
8.0.250.0060.00316.94
8.0.240.0000.00717.05
8.0.230.0030.00616.96
8.0.220.0040.00416.97
8.0.210.0000.00716.88
8.0.200.0030.00317.06
8.0.190.0040.00417.00
8.0.180.0030.00316.92
8.0.170.0000.00717.02
8.0.160.0000.00716.88
8.0.150.0000.00716.82
8.0.140.0030.00516.97
8.0.130.0050.00013.39
8.0.120.0030.00516.93
8.0.110.0050.00316.86
8.0.100.0040.00416.84
8.0.90.0030.00517.00
8.0.80.0070.00716.98
8.0.70.0050.00216.89
8.0.60.0040.00416.99
8.0.50.0030.00516.88
8.0.30.0130.00217.07
8.0.20.0110.01017.40
8.0.10.0040.00417.13
8.0.00.0090.01116.84
7.4.330.0000.00515.09
7.4.320.0000.00616.45
7.4.300.0000.00616.55
7.4.290.0040.00416.60
7.4.280.0040.00416.61
7.4.270.0040.00416.45
7.4.260.0000.00716.51
7.4.250.0030.00316.59
7.4.240.0040.00316.59
7.4.230.0030.00516.70
7.4.220.0090.00916.64
7.4.210.0080.01016.64
7.4.200.0070.00016.38
7.4.160.0070.00716.47
7.4.150.0060.01117.40
7.4.140.0140.01017.86
7.4.130.0080.01216.56
7.4.120.0090.00816.38
7.4.110.0110.01416.50
7.4.100.0110.00716.51
7.4.90.0070.01816.62
7.4.80.0090.01219.39
7.4.70.0080.00816.62
7.4.60.0110.00516.39
7.4.50.0000.00816.31
7.4.40.0140.00716.37
7.4.30.0120.00916.56
7.4.00.0080.00714.77
7.3.330.0060.00013.26
7.3.320.0000.00513.14
7.3.310.0000.00716.21
7.3.300.0030.00316.36
7.3.290.0000.00716.18
7.3.280.0080.00816.33
7.3.270.0100.00717.40
7.3.260.0100.01016.38
7.3.250.0090.00816.33
7.3.240.0090.00916.35
7.3.230.0100.00716.39
7.3.210.0070.01016.50
7.3.200.0190.00016.40
7.3.190.0080.00816.34
7.3.180.0130.00616.32
7.3.170.0100.01016.30
7.3.160.0100.00616.61
7.3.120.0030.01314.87
7.3.110.0120.00414.49
7.3.100.0000.01314.81
7.3.90.0090.00614.82
7.3.80.0110.00314.70
7.3.70.0060.00914.89
7.3.60.0060.00914.66
7.3.50.0080.00814.80
7.3.40.0070.00714.73
7.3.30.0070.00714.79
7.3.20.0040.01116.63
7.3.10.0110.00416.47
7.3.00.0100.00716.52
7.2.330.0030.01616.58
7.2.320.0040.01816.81
7.2.310.0120.01216.68
7.2.300.0070.01016.67
7.2.290.0160.00616.61
7.2.250.0120.00414.86
7.2.240.0100.01015.20
7.2.230.0030.01015.28
7.2.220.0100.00315.18
7.2.210.0090.00614.87
7.2.200.0030.01014.97
7.2.190.0130.00315.13
7.2.180.0090.00614.79
7.2.170.0070.00414.83
7.2.60.0080.00416.97
7.2.00.0060.00919.34
7.1.330.0100.00615.81
7.1.320.0030.01315.86
7.1.310.0040.01215.86
7.1.300.0030.01015.77
7.1.290.0060.00615.50
7.1.280.0040.00815.63
7.1.270.0030.01015.97
7.1.260.0070.01015.74
7.1.200.0060.00315.75
7.1.100.0040.01118.23
7.1.70.0000.00817.08
7.1.60.0070.01319.43
7.1.50.0030.01816.99
7.1.00.0000.07722.45
7.0.200.0200.00714.47
7.0.60.0070.03720.01
7.0.50.0070.07017.88
7.0.40.0030.04320.13
7.0.30.0570.06320.23
7.0.20.0370.07320.33
7.0.10.0100.05020.23
7.0.00.0070.05020.22
5.6.280.0070.06321.05
5.6.210.0070.03720.55
5.6.200.0100.05718.18
5.6.190.0000.05320.48
5.6.180.0300.08320.55
5.6.170.0270.06720.57
5.6.160.0100.08020.55
5.6.150.0130.06718.12
5.6.140.0130.07318.15
5.6.130.0230.07018.28
5.6.120.0070.05321.06
5.6.110.0070.08721.01
5.6.100.0100.08021.11
5.6.90.0100.07320.88
5.6.80.0030.06720.48
5.5.350.0270.02720.39
5.5.340.0070.07317.97
5.5.330.0070.06720.57
5.5.320.0230.04020.51
5.5.310.0430.06720.37
5.5.300.0070.06018.02
5.5.290.0030.08717.98
5.5.280.0070.04020.69
5.5.270.0070.04720.96
5.5.260.0070.03720.76
5.5.250.0100.05720.50
5.5.240.0070.08320.24
5.4.450.0170.05019.54
5.4.440.0070.06019.58
5.4.430.0130.06019.30
5.4.420.0300.06319.58
5.4.410.0230.07719.25
5.4.400.0230.04719.14
5.4.390.0130.05719.14
5.4.380.0170.04719.23
5.4.370.0030.06019.16
5.4.360.0130.05319.27
5.4.350.0070.06019.25
5.4.340.0200.05019.28
5.4.320.0300.04018.96
5.4.310.0130.05319.35
5.4.300.0130.05318.99
5.4.290.0300.05319.11
5.4.280.0270.06018.83
5.4.270.0370.03319.26
5.4.260.0200.06019.27
5.4.250.0270.04019.14
5.4.240.0170.04719.00
5.4.230.0200.04719.14
5.4.220.0130.05319.27
5.4.210.0200.06019.14
5.4.200.0170.05318.99
5.4.190.0300.04319.23
5.4.180.0170.05019.23
5.4.170.0130.05319.20
5.4.160.0170.05019.23
5.4.150.0130.06019.03
5.4.140.0230.04316.33
5.4.130.0200.04016.44
5.4.120.0130.05016.26
5.4.110.0100.05316.51
5.4.100.0100.05316.53
5.4.90.0200.04316.59
5.4.80.0270.03716.17
5.4.70.0100.05016.55
5.4.60.0130.04716.40
5.4.50.0070.05316.23
5.4.40.0230.04016.23
5.4.30.0130.04716.38
5.4.20.0200.04316.49
5.4.10.0230.04316.59
5.4.00.0030.05315.94

preferences:
51.44 ms | 400 KiB | 5 Q