3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Singleton { private static $instanciated = false; public function __construct() { if (self::$instanciated) { throw new RuntimeException('Could not instanciate class'); } self::$instanciated = true; } private $var; public function get(): int { return $this->var; } public function set(int $value) { $this->var = $value; } } class Factory { private $instance = null; public function getInstance() { if ($this->instance === null) { $this->instance = new Singleton(); } return $this->instance; } } $factory = new Factory(); $o = $factory->getInstance(); $o->set(5); $factory2 = new Factory(); $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.0040.01116.75
8.3.50.0210.00922.11
8.3.40.0120.00318.75
8.3.30.0000.01418.90
8.3.20.0090.00620.33
8.3.10.0060.00323.67
8.3.00.0080.00019.22
8.2.180.0110.01418.41
8.2.170.0030.01022.96
8.2.160.0120.00320.44
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0060.00317.63
8.2.110.0000.01121.13
8.2.100.0070.00417.78
8.2.90.0080.00019.08
8.2.80.0040.00417.97
8.2.70.0080.00017.63
8.2.60.0040.00417.80
8.2.50.0030.00618.07
8.2.40.0040.00419.52
8.2.30.0040.00420.56
8.2.20.0070.00017.63
8.2.10.0090.00017.91
8.2.00.0080.00017.91
8.1.280.0030.01225.92
8.1.270.0060.00324.02
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00621.29
8.1.230.0080.00420.87
8.1.220.0040.00417.74
8.1.210.0090.00018.77
8.1.200.0060.00317.35
8.1.190.0050.00317.13
8.1.180.0000.00818.10
8.1.170.0000.00918.81
8.1.160.0040.00421.88
8.1.150.0040.00718.82
8.1.140.0040.00419.40
8.1.130.0040.00417.64
8.1.120.0070.00017.32
8.1.110.0000.00717.35
8.1.100.0040.00417.31
8.1.90.0000.00717.32
8.1.80.0100.00017.39
8.1.70.0030.00317.48
8.1.60.0030.00617.53
8.1.50.0000.00917.54
8.1.40.0030.00617.52
8.1.30.0040.00417.70
8.1.20.0040.00417.66
8.1.10.0040.00417.60
8.1.00.0040.00417.55
8.0.300.0050.00318.77
8.0.290.0060.00316.63
8.0.280.0030.00318.38
8.0.270.0030.00317.21
8.0.260.0000.00617.23
8.0.250.0000.00716.86
8.0.240.0060.00316.95
8.0.230.0030.00616.84
8.0.220.0070.00016.86
8.0.210.0040.00416.72
8.0.200.0030.00316.93
8.0.190.0060.00316.88
8.0.180.0070.00016.88
8.0.170.0000.00716.88
8.0.160.0040.00416.74
8.0.150.0030.00616.68
8.0.140.0050.00216.79
8.0.130.0000.00513.30
8.0.120.0050.00316.72
8.0.110.0080.00016.73
8.0.100.0080.00016.95
8.0.90.0080.00016.74
8.0.80.0100.00616.84
8.0.70.0040.00416.87
8.0.60.0040.00416.78
8.0.50.0020.00516.81
8.0.30.0150.00617.12
8.0.20.0090.01017.40
8.0.10.0040.00417.01
8.0.00.0100.01016.85
7.4.330.0030.00315.09
7.4.320.0030.00316.63
7.4.300.0030.00316.41
7.4.290.0070.00016.51
7.4.280.0080.00016.53
7.4.270.0000.00816.53
7.4.260.0050.00316.61
7.4.250.0000.00716.54
7.4.240.0040.00316.53
7.4.230.0070.00016.65
7.4.220.0060.01216.63
7.4.210.0060.01316.62
7.4.200.0070.00016.70
7.4.160.0120.00316.38
7.4.150.0120.00917.40
7.4.140.0130.00917.86
7.4.130.0070.01116.49
7.4.120.0110.00616.54
7.4.110.0070.01716.51
7.4.100.0150.00416.59
7.4.90.0160.00016.38
7.4.80.0090.00919.39
7.4.70.0100.01316.59
7.4.60.0140.00316.52
7.4.50.0000.00516.26
7.4.40.0100.00716.45
7.4.30.0090.01216.56
7.4.10.0070.01015.11
7.4.00.0060.00914.98
7.3.330.0000.00513.31
7.3.320.0030.00313.14
7.3.310.0070.00016.13
7.3.300.0000.00716.30
7.3.290.0070.00016.35
7.3.280.0090.01216.27
7.3.270.0060.01217.40
7.3.260.0110.00516.36
7.3.250.0050.01116.38
7.3.240.0110.00716.28
7.3.230.0090.00916.43
7.3.210.0000.01616.32
7.3.200.0070.01016.42
7.3.190.0100.00616.46
7.3.180.0060.01016.58
7.3.170.0060.01016.61
7.3.160.0110.00616.41
7.3.130.0110.00414.88
7.3.120.0060.01114.83
7.3.110.0020.01414.73
7.3.100.0070.00814.85
7.3.90.0050.00914.73
7.3.80.0040.00614.84
7.3.70.0040.00914.79
7.3.60.0060.00814.85
7.3.50.0050.01014.60
7.3.40.0040.01114.75
7.3.30.0070.00614.75
7.3.20.0080.00716.72
7.3.10.0040.01016.61
7.3.00.0060.00816.56
7.2.330.0160.00616.80
7.2.320.0160.00416.76
7.2.310.0030.01216.73
7.2.300.0100.00716.46
7.2.290.0140.00916.54
7.2.260.0070.01314.79
7.2.250.0070.01114.93
7.2.240.0090.00815.10
7.2.230.0050.01014.95
7.2.220.0050.01015.09
7.2.210.0020.01214.97
7.2.200.0080.00415.00
7.2.190.0100.00615.05
7.2.180.0030.01314.97
7.2.170.0080.00615.11
7.2.160.0090.00514.90
7.2.150.0050.01116.74
7.2.140.0110.00216.66
7.2.130.0090.00816.82
7.2.120.0110.00616.95
7.2.110.0080.00816.79
7.2.100.0040.00916.92
7.2.90.0070.01016.86
7.2.80.0080.00716.87
7.2.70.0070.00616.83
7.2.60.0070.00716.86
7.2.50.0060.00716.88
7.2.40.0110.00416.92
7.2.30.0060.00816.92
7.2.20.0050.00916.78
7.2.10.0040.01016.85
7.2.00.0060.01017.22
7.1.330.0060.00915.69
7.1.320.0050.00715.79
7.1.310.0060.00815.81
7.1.300.0060.00915.74
7.1.290.0060.00715.75
7.1.280.0020.01115.78
7.1.270.0080.00615.71
7.1.260.0060.00815.80
7.1.250.0130.00415.59
7.1.240.0050.01015.59
7.1.230.0050.01015.60
7.1.220.0030.00915.72
7.1.210.0060.00715.53
7.1.200.0030.01015.64
7.1.190.0070.00815.70
7.1.180.0050.00815.71
7.1.170.0060.00815.65
7.1.160.0070.00615.63
7.1.150.0050.00915.63
7.1.140.0050.00615.75
7.1.130.0050.00715.78
7.1.120.0070.00515.57
7.1.110.0070.00515.69
7.1.100.0070.00816.28
7.1.90.0070.00615.58
7.1.80.0050.00715.79
7.1.70.0010.01016.05
7.1.60.0070.00816.63
7.1.50.0060.00615.88
7.1.40.0070.00615.77
7.1.30.0050.01015.60
7.1.20.0050.00915.61
7.1.10.0070.00515.51
7.1.00.0050.02517.22
7.0.330.0140.00515.45
7.0.320.0070.00615.27
7.0.310.0060.00615.15
7.0.300.0030.01015.38
7.0.290.0070.00815.25
7.0.280.0100.00515.17
7.0.270.0060.00415.40
7.0.260.0070.00815.07
7.0.250.0080.00715.26
7.0.240.0060.00815.38
7.0.230.0070.00815.26
7.0.220.0030.00915.39
7.0.210.0060.00715.25
7.0.200.0090.00514.99
7.0.190.0080.00615.34
7.0.180.0080.00815.37
7.0.170.0050.00715.31
7.0.160.0070.00715.34
7.0.150.0060.00615.31
7.0.140.0060.00715.29
7.0.130.0050.01015.16
7.0.120.0030.00815.42
7.0.110.0100.00515.27
7.0.100.0090.00615.30
7.0.90.0060.00615.38
7.0.80.0080.00715.29
7.0.70.0040.01015.33
7.0.60.0080.01416.43
7.0.50.0060.02515.95
7.0.40.0050.01715.16
7.0.30.0090.01815.05
7.0.20.0120.02415.11
7.0.10.0060.01615.00
7.0.00.0070.02615.14
5.6.400.0070.00714.34
5.6.390.0090.00414.38
5.6.380.0070.00614.11
5.6.370.0090.00213.96
5.6.360.0080.00514.03
5.6.350.0050.00814.14
5.6.340.0050.00814.27
5.6.330.0050.00914.07
5.6.320.0050.00714.19
5.6.310.0030.00913.91
5.6.300.0040.00914.04
5.6.290.0040.01114.05
5.6.280.0060.01615.77
5.6.270.0060.00713.99
5.6.260.0050.00914.06
5.6.250.0060.00513.93
5.6.240.0060.00714.18
5.6.230.0050.00614.08
5.6.220.0070.00514.11
5.6.210.0030.01815.73
5.6.200.0070.02514.99
5.6.190.0080.02115.62
5.6.180.0080.02115.58
5.6.170.0100.02515.62
5.6.160.0090.01715.72
5.6.150.0070.02315.13
5.6.140.0060.02414.99
5.6.130.0060.02415.10
5.6.120.0070.02515.76
5.6.110.0090.02215.81
5.6.100.0060.02315.72
5.6.90.0070.02515.86
5.6.80.0070.02115.53
5.6.70.0020.00813.86
5.6.60.0060.00813.81
5.6.50.0090.00514.05
5.6.40.0040.00613.93
5.6.30.0060.00714.01
5.6.20.0070.00813.80
5.6.10.0080.00613.82
5.6.00.0020.01013.96
5.5.380.0070.00312.01
5.5.370.0060.00512.00
5.5.360.0040.00511.92
5.5.350.0060.01414.21
5.5.340.0060.01913.56
5.5.330.0060.02414.01
5.5.320.0070.01714.18
5.5.310.0120.01514.08
5.5.300.0040.01713.41
5.5.290.0030.02613.44
5.5.280.0050.01414.29
5.5.270.0030.01614.36
5.5.260.0030.01714.24
5.5.250.0080.02014.21
5.5.240.0040.02714.15
5.5.230.0010.01311.85
5.5.220.0050.00611.93
5.5.210.0040.00811.88
5.5.200.0050.00711.97
5.5.190.0080.00511.95
5.5.180.0100.00111.97
5.5.170.0030.00712.01
5.5.160.0020.00912.10
5.5.150.0020.00812.05
5.5.140.0050.00511.96
5.5.130.0050.00612.05
5.5.120.0030.00812.12
5.5.110.0040.00612.05
5.5.100.0040.00612.08
5.5.90.0040.00711.97
5.5.80.0040.00712.00
5.5.70.0030.00911.95
5.5.60.0040.00512.03
5.5.50.0060.00411.89
5.5.40.0080.00211.92
5.5.30.0030.00812.06
5.5.20.0050.00312.01
5.5.10.0020.00712.04
5.5.00.0060.00412.05
5.4.450.0270.01813.12
5.4.440.0180.02213.02
5.4.430.0170.02113.08
5.4.420.0080.01813.13
5.4.410.0100.01513.16
5.4.400.0040.02112.89
5.4.390.0080.02012.97
5.4.380.0130.02013.00
5.4.370.0080.02012.93
5.4.360.0100.01812.87
5.4.350.0080.01812.94
5.4.340.0090.01712.93
5.4.330.0020.00710.92
5.4.320.0070.02012.92
5.4.310.0110.02012.90
5.4.300.0040.02012.92
5.4.290.0050.02012.94
5.4.280.0100.01512.89
5.4.270.0100.01812.92
5.4.260.0110.01512.87
5.4.250.0050.01813.06
5.4.240.0080.02212.83
5.4.230.0080.02412.87
5.4.220.0100.01412.97
5.4.210.0110.01613.06
5.4.200.0050.01812.97
5.4.190.0070.02012.97
5.4.180.0050.01713.04
5.4.170.0060.02112.95
5.4.160.0070.01712.86
5.4.150.0060.01613.03
5.4.140.0080.01712.35
5.4.130.0120.01612.27
5.4.120.0230.01912.34
5.4.110.0090.02212.30
5.4.100.0060.01812.39
5.4.90.0090.01712.32
5.4.80.0070.01812.34
5.4.70.0110.01612.36
5.4.60.0080.01712.30
5.4.50.0130.01712.33
5.4.40.0140.02012.34
5.4.30.0080.01612.28
5.4.20.0100.01512.31
5.4.10.0120.01412.28
5.4.00.0040.01812.19

preferences:
57.86 ms | 401 KiB | 5 Q