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; } } $factory = new Factory(); $o = $factory->getInstance(); var_dump($o); $o->set(5); $o2 = $factory->getInstance(); var_dump($o2->get());

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.0110.00716.37
8.3.50.0130.00722.05
8.3.40.0140.00318.63
8.3.30.0090.00618.71
8.3.20.0040.00420.16
8.3.10.0080.00023.53
8.3.00.0030.00519.25
8.2.180.0070.01418.41
8.2.170.0030.01422.96
8.2.160.0030.01020.22
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0090.00017.50
8.2.110.0080.00322.25
8.2.100.0070.00417.93
8.2.90.0040.00419.22
8.2.80.0040.00417.97
8.2.70.0000.00817.75
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0060.00319.45
8.2.30.0030.00320.70
8.2.20.0080.00017.68
8.2.10.0000.00818.00
8.2.00.0070.00018.11
8.1.280.0070.01125.92
8.1.270.0080.00023.81
8.1.260.0000.00826.35
8.1.250.0000.00728.09
8.1.240.0090.00022.54
8.1.230.0120.00017.66
8.1.220.0090.00017.79
8.1.210.0080.00018.77
8.1.200.0030.00617.13
8.1.190.0040.00417.22
8.1.180.0050.00318.10
8.1.170.0030.00518.88
8.1.160.0000.00822.01
8.1.150.0070.00018.85
8.1.140.0040.00419.54
8.1.130.0050.00217.75
8.1.120.0040.00417.53
8.1.110.0000.00717.36
8.1.100.0050.00217.45
8.1.90.0000.00717.46
8.1.80.0040.00417.45
8.1.70.0000.00817.42
8.1.60.0030.00517.61
8.1.50.0030.00517.55
8.1.40.0000.00817.52
8.1.30.0040.00417.69
8.1.20.0080.00017.48
8.1.10.0060.00317.55
8.1.00.0030.00517.46
8.0.300.0000.00718.77
8.0.290.0000.00716.63
8.0.280.0000.00818.45
8.0.270.0000.00717.23
8.0.260.0000.00617.21
8.0.250.0000.00816.90
8.0.240.0080.00016.88
8.0.230.0030.00616.86
8.0.220.0060.00316.80
8.0.210.0080.00016.93
8.0.200.0000.00616.96
8.0.190.0040.00416.93
8.0.180.0040.00417.00
8.0.170.0040.00416.94
8.0.160.0000.00716.86
8.0.150.0060.00316.73
8.0.140.0050.00316.82
8.0.130.0000.00613.30
8.0.120.0040.00416.79
8.0.110.0070.00016.75
8.0.100.0070.00016.79
8.0.90.0040.00416.75
8.0.80.0090.00616.85
8.0.70.0040.00416.96
8.0.60.0070.00016.80
8.0.50.0030.00516.79
8.0.30.0120.00816.97
8.0.20.0100.01217.40
8.0.10.0000.00816.88
8.0.00.0090.00816.85
7.4.330.0020.00215.13
7.4.320.0030.00316.51
7.4.300.0030.00316.57
7.4.290.0020.00516.59
7.4.280.0000.00816.59
7.4.270.0000.00716.52
7.4.260.0030.00316.59
7.4.250.0040.00416.45
7.4.240.0020.00516.56
7.4.230.0030.00316.72
7.4.220.0070.01116.50
7.4.210.0060.01116.59
7.4.200.0030.00316.68
7.4.160.0030.01016.43
7.4.150.0090.00917.40
7.4.140.0090.01517.86
7.4.130.0170.00916.72
7.4.120.0080.01016.53
7.4.110.0070.01716.63
7.4.100.0070.01016.43
7.4.90.0030.01416.55
7.4.80.0090.00919.39
7.4.70.0060.01116.52
7.4.60.0090.00616.34
7.4.50.0040.00416.59
7.4.40.0190.00316.55
7.4.30.0140.00316.54
7.4.00.0060.00914.70
7.3.330.0050.00013.28
7.3.320.0000.00513.33
7.3.310.0000.00616.34
7.3.300.0030.00316.35
7.3.290.0040.00416.27
7.3.280.0120.00216.29
7.3.270.0100.00717.40
7.3.260.0100.00716.29
7.3.240.0110.00616.31
7.3.230.0130.00316.48
7.3.210.0090.01216.63
7.3.200.0130.00916.20
7.3.190.0100.00716.40
7.3.180.0130.00316.41
7.3.170.0100.01416.39
7.3.160.0000.01616.61
7.2.330.0080.01116.67
7.2.320.0060.01316.84
7.2.310.0110.00616.75
7.2.300.0060.01016.61
7.2.290.0050.01216.60
7.2.60.0070.00717.05
7.2.00.0030.01019.42
7.1.200.0060.00615.75
7.1.70.0000.01016.95
7.1.60.0040.00717.19
7.1.50.0110.00616.99
7.1.00.0000.08022.30
7.0.200.0070.01016.68
7.0.60.0100.07019.80
7.0.50.0100.07717.97
7.0.40.0030.05720.13
7.0.30.0500.07020.08
7.0.20.0370.07020.23
7.0.10.0100.08320.10
7.0.00.0130.08320.18
5.6.280.0000.06020.91
5.6.210.0130.07320.54
5.6.200.0070.08718.16
5.6.190.0070.04320.63
5.6.180.0300.05320.48
5.6.170.0400.03320.53
5.6.160.0070.07320.61
5.6.150.0100.07318.19
5.6.140.0100.08018.12
5.6.130.0070.08018.15
5.6.120.0100.08021.02
5.6.110.0170.08021.11
5.6.100.0130.07320.93
5.6.90.0130.08320.90
5.6.80.0030.08320.40
5.5.350.0300.08320.36
5.5.340.0070.08017.95
5.5.330.0030.09320.48
5.5.320.0300.03320.35
5.5.310.0400.07320.23
5.5.300.0170.07017.98
5.5.290.0030.08317.93
5.5.280.0130.06720.73
5.5.270.0100.05020.84
5.5.260.0170.06320.79
5.5.250.0170.06020.62
5.5.240.0070.08020.19
5.4.450.0700.05719.57
5.4.440.0570.07019.66
5.4.430.0370.06319.40
5.4.420.0700.05019.52
5.4.410.0830.05019.42
5.4.400.0400.06019.00
5.4.390.0230.05019.17
5.4.380.0700.05319.34
5.4.370.0800.05019.08
5.4.360.0570.06019.25
5.4.350.0730.07018.81
5.4.340.0670.05719.34
5.4.320.0100.05319.09
5.4.310.0330.05318.80
5.4.300.0200.06319.34
5.4.290.0300.05019.05
5.4.280.0370.04719.23
5.4.270.0200.06019.07
5.4.260.0370.04719.07
5.4.250.0300.06719.20
5.4.240.0200.08018.91
5.4.230.0170.07019.05
5.4.220.0500.06719.04
5.4.210.0570.06019.20
5.4.200.0300.06019.21
5.4.190.0170.04719.20
5.4.180.0270.05719.11
5.4.170.0130.05019.25
5.4.160.0370.04719.20
5.4.150.0130.05319.23
5.4.140.0400.06016.36
5.4.130.0270.06016.35
5.4.120.0500.04316.72
5.4.110.0300.05316.47
5.4.100.0430.05716.64
5.4.90.0630.04016.64
5.4.80.0130.05716.51
5.4.70.0200.04316.60
5.4.60.0170.05016.25
5.4.50.0100.05316.49
5.4.40.0130.06716.62
5.4.30.0300.05716.57
5.4.20.0470.06016.58
5.4.10.0170.05016.54
5.4.00.0230.04316.02

preferences:
42.15 ms | 401 KiB | 5 Q