3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Factory { public function getInstance() { static $instance = null; if ($instance === null) { $instance = new class() { private $var; public function get() { return $this->var; } public function set($value) { $this->var = $value; } }; } return $instance; } } $f = new Factory(); $o = $f->getInstance(); $o->set(5); $o2 = $f->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.0070.01116.88
8.3.50.0150.00521.33
8.3.40.0060.00918.86
8.3.30.0110.00318.84
8.3.20.0040.00420.35
8.3.10.0090.00023.48
8.3.00.0030.00619.38
8.2.180.0110.00718.51
8.2.170.0140.00722.96
8.2.160.0130.00720.50
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0030.00617.38
8.2.110.0000.00922.00
8.2.100.0070.00417.93
8.2.90.0000.00819.05
8.2.80.0030.00517.97
8.2.70.0030.00617.63
8.2.60.0000.00817.91
8.2.50.0040.00418.07
8.2.40.0000.00719.23
8.2.30.0000.00720.50
8.2.20.0040.00417.68
8.2.10.0030.00518.12
8.2.00.0040.00417.92
8.1.280.0100.01025.92
8.1.270.0060.00323.91
8.1.260.0060.00326.35
8.1.250.0050.00328.09
8.1.240.0060.00322.59
8.1.230.0040.00817.54
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0030.00617.25
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0070.00318.59
8.1.160.0050.00221.91
8.1.150.0080.00018.89
8.1.140.0050.00319.62
8.1.130.0070.00017.63
8.1.120.0000.00817.44
8.1.110.0040.00417.53
8.1.100.0080.00317.48
8.1.90.0040.00417.47
8.1.80.0040.00417.39
8.1.70.0000.00717.48
8.1.60.0000.00817.47
8.1.50.0040.00417.55
8.1.40.0050.00317.57
8.1.30.0040.00417.64
8.1.20.0000.00717.64
8.1.10.0040.00417.54
8.1.00.0000.00817.56
8.0.300.0060.00318.77
8.0.290.0030.00516.75
8.0.280.0070.00018.51
8.0.270.0040.00717.26
8.0.260.0060.00317.27
8.0.250.0050.00316.98
8.0.240.0040.00416.97
8.0.230.0030.00517.00
8.0.220.0030.00316.89
8.0.210.0000.00716.91
8.0.200.0000.00816.97
8.0.190.0000.00816.91
8.0.180.0050.00316.95
8.0.170.0000.00716.81
8.0.160.0000.00716.81
8.0.150.0000.00716.86
8.0.140.0040.00416.74
8.0.130.0000.00613.39
8.0.120.0000.00716.77
8.0.110.0030.00516.85
8.0.100.0040.00416.88
8.0.90.0040.00416.92
8.0.80.0030.01516.81
8.0.70.0040.00416.84
8.0.60.0040.00316.82
8.0.50.0000.00816.77
8.0.30.0150.00516.82
8.0.20.0110.01317.40
8.0.10.0050.00316.98
8.0.00.0100.00716.75
7.4.330.0020.00215.08
7.4.320.0030.00316.62
7.4.300.0000.00616.57
7.4.290.0000.00716.54
7.4.280.0070.00016.51
7.4.270.0000.00716.52
7.4.260.0000.00716.49
7.4.250.0070.00016.41
7.4.240.0020.00516.62
7.4.230.0000.00816.57
7.4.220.0130.00616.55
7.4.210.0040.01016.70
7.4.200.0070.00016.64
7.4.160.0060.01116.54
7.4.150.0060.01217.40
7.4.140.0180.00817.86
7.4.130.0090.01116.55
7.4.120.0100.01016.50
7.4.110.0130.00416.43
7.4.100.0130.01016.41
7.4.90.0110.00816.39
7.4.80.0120.00819.39
7.4.70.0170.00316.40
7.4.60.0060.01516.50
7.4.50.0040.00416.44
7.4.40.0000.02116.56
7.4.30.0100.00716.51
7.4.00.0090.00615.15
7.3.330.0030.00313.27
7.3.320.0000.00513.16
7.3.310.0000.00816.31
7.3.300.0040.00416.19
7.3.290.0080.00716.31
7.3.280.0070.01216.31
7.3.270.0100.00717.40
7.3.260.0140.00316.62
7.3.250.0110.00916.31
7.3.240.0110.00916.29
7.3.230.0110.01116.60
7.3.210.0100.00616.59
7.3.200.0090.00616.50
7.3.190.0100.00916.38
7.3.180.0030.01316.42
7.3.170.0080.01116.40
7.3.160.0030.01316.61
7.3.120.0120.00414.98
7.3.110.0060.00914.70
7.3.100.0070.00414.89
7.3.90.0060.01014.77
7.3.80.0030.01014.97
7.3.70.0030.00914.47
7.3.60.0060.01014.70
7.3.50.0030.00714.67
7.3.40.0080.00814.80
7.3.30.0040.01114.95
7.3.20.0030.00616.62
7.3.10.0030.01316.68
7.3.00.0080.00316.46
7.2.330.0130.00616.48
7.2.320.0060.01616.61
7.2.310.0080.00816.74
7.2.300.0120.00916.50
7.2.290.0070.01116.54
7.2.240.0130.00314.76
7.2.230.0100.00614.81
7.2.220.0060.01014.89
7.2.210.0060.00914.66
7.2.200.0050.00515.06
7.2.190.0030.01014.96
7.2.180.0040.01115.01
7.2.170.0030.01014.96
7.2.160.0060.00615.13
7.2.150.0030.01316.67
7.2.140.0030.01017.04
7.2.130.0050.01016.89
7.2.120.0070.00716.76
7.2.110.0080.00416.88
7.2.100.0050.00716.75
7.2.90.0060.00916.94
7.2.80.0060.00816.83
7.2.70.0030.00816.93
7.2.60.0060.00817.04
7.2.50.0070.01016.79
7.2.40.0000.01217.04
7.2.30.0000.01517.10
7.2.20.0090.00616.74
7.2.10.0070.00716.74
7.2.00.0030.01117.80
7.1.330.0030.01015.77
7.1.320.0040.00715.88
7.1.310.0000.01615.95
7.1.300.0060.00915.90
7.1.290.0000.01515.63
7.1.280.0040.01115.76
7.1.270.0040.01215.47
7.1.260.0070.00715.81
7.1.250.0040.01015.47
7.1.200.0060.00615.87
7.1.100.0100.01017.79
7.1.70.0030.01017.14
7.1.60.0070.01719.43
7.1.50.0100.01416.98
7.1.00.0000.08022.54
7.0.200.0130.00714.99
7.0.60.0300.06319.92
7.0.50.0000.08717.87
7.0.40.0070.05020.05
7.0.30.0070.08720.23
7.0.20.0400.03320.09
7.0.10.0130.08320.12
7.0.00.0100.05320.16
5.6.280.0070.02721.00
5.6.210.0070.08020.70
5.6.200.0070.08318.14
5.6.190.0130.08320.41
5.6.180.0200.03720.58
5.6.170.0330.05020.50
5.6.160.0000.09320.63
5.6.150.0200.06718.18
5.6.140.0070.05718.21
5.6.130.0070.04718.27
5.6.120.0070.08720.90
5.6.110.0070.09721.09
5.6.100.0030.04021.01
5.6.90.0100.06720.98
5.6.80.0070.07320.29
5.5.350.0270.08320.29
5.5.340.0100.07718.09
5.5.330.0070.08320.43
5.5.320.0300.06720.42
5.5.310.0330.05720.23
5.5.300.0030.08317.97
5.5.290.0000.04717.95
5.5.280.0030.08020.88
5.5.270.0100.08320.88
5.5.260.0130.06720.77
5.5.250.0070.05720.66
5.5.240.0030.04020.35
5.4.450.0230.05319.16
5.4.440.0300.06019.27
5.4.430.0170.07719.56
5.4.420.0230.04719.59
5.4.410.0130.05719.46
5.4.400.0200.06019.23
5.4.390.0200.05019.22
5.4.380.0100.05718.84
5.4.370.0200.05719.08
5.4.360.0230.05719.05
5.4.350.0130.05719.34
5.4.340.0100.06019.27
5.4.320.0230.05019.27
5.4.310.0170.04719.02
5.4.300.0230.04319.23
5.4.290.0200.05319.23
5.4.280.0300.05318.85
5.4.270.0100.06019.11
5.4.260.0170.05319.26
5.4.250.0130.05318.95
5.4.240.0070.06019.34
5.4.230.0300.03719.11
5.4.220.0100.05719.22
5.4.210.0100.06019.20
5.4.200.0300.05718.83
5.4.190.0230.04319.10
5.4.180.0130.06019.25
5.4.170.0170.05319.22
5.4.160.0100.05719.21
5.4.150.0130.05319.23
5.4.140.0200.07316.57
5.4.130.0130.05316.41
5.4.120.0130.05016.34
5.4.110.0100.06316.53
5.4.100.0130.05016.45
5.4.90.0200.06716.45
5.4.80.0130.05016.59
5.4.70.0130.05016.44
5.4.60.0130.05016.49
5.4.50.0130.05316.25
5.4.40.0200.04716.50
5.4.30.0170.04716.57
5.4.20.0100.05316.42
5.4.10.0130.05016.57
5.4.00.0170.05315.78

preferences:
41.66 ms | 401 KiB | 5 Q