3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Singleton { private static $instance; private function __construct() {} private function __clone() {} private function __wakeup() {} public function getInstance() { if (empty(static::$instanse)) { return new static(); } else { return static::$instance; } } } class Foo { use Singleton; private $bar = 2; public function incBar() { $this->bar++; } public function getBar() { return $this->bar."<br/>"; } } $foo = Foo::getInstance(); echo $foo->getBar(); $foo->incBar(); echo $foo->getBar();

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.63
8.3.50.0080.01222.05
8.3.40.0070.00718.75
8.3.30.0070.00718.67
8.3.20.0040.00420.39
8.3.10.0040.00423.52
8.3.00.0060.00319.50
8.2.180.0080.00616.63
8.2.170.0170.00322.96
8.2.160.0030.01019.34
8.2.150.0030.00524.18
8.2.140.0050.00324.66
8.2.130.0060.00617.50
8.2.120.0080.00026.35
8.2.110.0100.00320.29
8.2.100.0040.00817.91
8.2.90.0000.00817.97
8.2.80.0050.00317.97
8.2.70.0030.00517.38
8.2.60.0000.00917.79
8.2.50.0000.00818.07
8.2.40.0040.00419.41
8.2.30.0040.00420.55
8.2.20.0040.00417.77
8.2.10.0000.00718.07
8.2.00.0040.00418.19
8.1.280.0100.00625.92
8.1.270.0080.00323.96
8.1.260.0070.00028.09
8.1.250.0070.00028.09
8.1.240.0000.01022.65
8.1.230.0070.00320.97
8.1.220.0000.00917.74
8.1.210.0000.00818.89
8.1.200.0090.00017.23
8.1.190.0080.00017.35
8.1.180.0040.00418.10
8.1.170.0000.00820.45
8.1.160.0050.00221.98
8.1.150.0030.00618.81
8.1.140.0000.00819.60
8.1.130.0080.00017.77
8.1.120.0040.00317.47
8.1.110.0040.00417.31
8.1.100.0040.00417.45
8.1.90.0000.00717.33
8.1.80.0000.00717.38
8.1.70.0030.00317.23
8.1.60.0060.00317.50
8.1.50.0040.00417.43
8.1.40.0040.00417.38
8.1.30.0070.00417.63
8.1.20.0030.00717.56
8.1.10.0000.00717.43
8.1.00.0090.00317.43
8.0.300.0000.00820.02
8.0.290.0040.00416.63
8.0.280.0080.00018.54
8.0.270.0000.00717.33
8.0.260.0030.00317.19
8.0.250.0030.00317.03
8.0.240.0000.00717.08
8.0.230.0050.00317.05
8.0.220.0000.00817.01
8.0.210.0000.00716.88
8.0.200.0030.00316.92
8.0.190.0000.00716.96
8.0.180.0000.00817.02
8.0.170.0040.00416.96
8.0.160.0050.00316.97
8.0.150.0000.00716.95
8.0.140.0000.00816.89
8.0.130.0000.00513.39
8.0.120.0040.00416.96
8.0.110.0040.00416.96
8.0.100.0040.00416.90
8.0.90.0000.00716.83
8.0.80.0100.01316.95
8.0.70.0070.00016.93
8.0.60.0000.00816.87
8.0.50.0040.00416.99
8.0.30.0090.01116.94
8.0.20.0090.01517.40
8.0.10.0000.00816.84
8.0.00.0110.01016.80
7.4.330.0020.00216.69
7.4.320.0040.00416.55
7.4.300.0000.00616.64
7.4.290.0030.00316.53
7.4.280.0000.00816.59
7.4.270.0070.00016.66
7.4.260.0030.00316.63
7.4.250.0030.00516.58
7.4.240.0040.00416.49
7.4.230.0000.00716.62
7.4.220.0120.00616.55
7.4.210.0100.00316.56
7.4.200.0050.00316.57
7.4.160.0060.01316.65
7.4.150.0170.00317.40
7.4.140.0120.01017.86
7.4.130.0090.01016.57
7.4.120.0120.00716.53
7.4.110.0070.01116.54
7.4.100.0150.00316.49
7.4.90.0060.01516.49
7.4.80.0060.01219.39
7.4.70.0170.00616.43
7.4.60.0150.00016.52
7.4.50.0030.01116.35
7.4.40.0100.00716.58
7.4.30.0130.00716.55
7.4.10.0070.01115.00
7.4.00.0080.01015.04
7.3.330.0000.00513.30
7.3.320.0050.00013.39
7.3.310.0040.00416.48
7.3.300.0070.00016.33
7.3.290.0080.00616.36
7.3.280.0120.00716.36
7.3.270.0080.00817.40
7.3.260.0110.00716.31
7.3.250.0080.01016.48
7.3.240.0120.00816.36
7.3.230.0170.00016.50
7.3.210.0070.01416.25
7.3.200.0080.00816.51
7.3.190.0070.01116.48
7.3.180.0000.01516.41
7.3.170.0100.00616.60
7.3.160.0090.01016.31
7.3.130.0000.01814.80
7.3.120.0130.00314.60
7.3.110.0060.00914.61
7.3.100.0100.00014.84
7.3.90.0060.00614.96
7.3.80.0090.00314.71
7.3.70.0000.01414.87
7.3.60.0130.00314.88
7.3.50.0090.00414.71
7.3.40.0000.01414.77
7.3.30.0000.01414.72
7.3.20.0000.01616.83
7.3.10.0070.01016.59
7.3.00.0000.01616.81
7.2.330.0130.00316.38
7.2.320.0120.00616.82
7.2.310.0060.01016.85
7.2.300.0130.00316.45
7.2.290.0170.01416.81
7.2.260.0110.00715.12
7.2.250.0080.00315.32
7.2.240.0060.00915.21
7.2.230.0090.00314.80
7.2.220.0130.00015.15
7.2.210.0030.00715.13
7.2.200.0070.00414.96
7.2.190.0040.00814.67
7.2.180.0070.01014.77
7.2.170.0120.00015.08
7.2.160.0040.00715.04
7.2.150.0040.01217.13
7.2.140.0000.01617.02
7.2.130.0080.00417.03
7.2.120.0030.01216.93
7.2.110.0060.00616.92
7.2.100.0070.01116.73
7.2.90.0060.00916.85
7.2.80.0120.00616.96
7.2.70.0040.00816.85
7.2.60.0090.00416.84
7.2.50.0100.00616.86
7.2.40.0080.00316.82
7.2.30.0070.00716.77
7.2.20.0070.00716.85
7.2.10.0110.00316.85
7.2.00.0050.01018.24
7.1.330.0060.00915.81
7.1.320.0060.00615.60
7.1.310.0070.00715.38
7.1.300.0030.01015.58
7.1.290.0070.00415.86
7.1.280.0040.01115.75
7.1.270.0000.00815.76
7.1.260.0100.00715.76
7.1.250.0070.00715.70
7.1.240.0100.00715.30
7.1.230.0000.01315.62
7.1.220.0000.01715.47
7.1.210.0000.01315.89
7.1.200.0050.00515.83
7.1.190.0030.00615.84
7.1.180.0060.00315.50
7.1.170.0030.01015.66
7.1.160.0050.00515.92
7.1.150.0070.00715.90
7.1.140.0040.01115.62
7.1.130.0070.00715.50
7.1.120.0030.00815.81
7.1.110.0030.00615.57
7.1.100.0050.00916.76
7.1.90.0060.00915.69
7.1.80.0030.00715.54
7.1.70.0070.00216.34
7.1.60.0050.01217.58
7.1.50.0040.01416.29
7.1.40.0040.01115.86
7.1.30.0060.00915.84
7.1.20.0060.00315.83
7.1.10.0090.00615.44
7.1.00.0050.04119.12
7.0.330.0000.01515.18
7.0.320.0060.00615.48
7.0.310.0040.01115.57
7.0.300.0070.00715.12
7.0.290.0110.00015.46
7.0.280.0000.00915.38
7.0.270.0070.00715.05
7.0.260.0090.00315.31
7.0.250.0050.00515.30
7.0.240.0090.00615.50
7.0.230.0040.01215.50
7.0.220.0060.00915.55
7.0.210.0030.00615.45
7.0.200.0220.01215.15
7.0.190.0060.00615.50
7.0.180.0040.00715.32
7.0.170.0090.00315.25
7.0.160.0080.00815.45
7.0.150.0030.01215.21
7.0.140.0100.00315.20
7.0.130.0100.00315.13
7.0.120.0000.01715.44
7.0.110.0030.00615.44
7.0.100.0060.00315.50
7.0.90.0060.00615.36
7.0.80.0040.00815.17
7.0.70.0060.00315.20
7.0.60.0020.04017.71
7.0.50.0050.04216.69
7.0.40.0050.05016.92
7.0.30.0140.02216.83
7.0.20.0130.03016.81
7.0.10.0100.04216.89
7.0.00.0030.05116.86
5.6.400.0000.01114.30
5.6.390.0080.00614.08
5.6.380.0060.01014.21
5.6.370.0000.01514.45
5.6.360.0000.01514.39
5.6.350.0000.01714.59
5.6.340.0030.01314.42
5.6.330.0070.01114.40
5.6.320.0080.00314.56
5.6.310.0030.01014.38
5.6.300.0100.00614.29
5.6.290.0060.00614.09
5.6.280.0050.03217.89
5.6.270.0030.01014.39
5.6.260.0030.00914.29
5.6.250.0090.00314.46
5.6.240.0060.00914.12
5.6.230.0070.00714.21
5.6.220.0000.01414.56
5.6.210.0090.02117.54
5.6.200.0030.04616.22
5.6.190.0050.03117.38
5.6.180.0100.02817.53
5.6.170.0150.03617.37
5.6.160.0080.04317.55
5.6.150.0080.04416.33
5.6.140.0020.02916.26
5.6.130.0100.04316.27
5.6.120.0070.04017.62
5.6.110.0070.04217.86
5.6.100.0130.04117.60
5.6.90.0090.04517.68
5.6.80.0080.04517.39
5.6.70.0070.01114.32
5.6.60.0030.00714.11
5.6.50.0030.00714.28
5.6.40.0060.00614.08
5.6.30.0070.00714.33
5.6.20.0060.00614.37
5.6.10.0000.01414.33
5.6.00.0000.01314.32
5.5.380.0060.00614.13
5.5.370.0030.01014.00
5.5.360.0090.00614.23
5.5.350.0220.03417.30
5.5.340.0070.04215.98
5.5.330.0080.04217.31
5.5.320.0070.04217.11
5.5.310.0180.03517.35
5.5.300.0060.03716.35
5.5.290.0070.03716.28
5.5.280.0070.04717.38
5.5.270.0060.03317.60
5.5.260.0050.02517.54
5.5.250.0080.03517.49
5.5.240.0130.04417.26
5.5.230.0000.01514.20
5.5.220.0090.00314.31
5.5.210.0000.01414.35
5.5.200.0000.00914.12
5.5.190.0090.00614.19
5.5.180.0000.01314.13
5.5.170.0030.00913.99
5.5.160.0030.01314.20
5.5.150.0000.00814.14
5.5.140.0000.01414.35
5.5.130.0000.01014.09
5.5.120.0080.00314.31
5.5.110.0040.01114.27
5.5.100.0000.01214.28
5.5.90.0070.00314.46
5.5.80.0030.00714.34
5.5.70.0030.00814.35
5.5.60.0000.01114.06
5.5.50.0000.01514.22
5.5.40.0110.00414.04
5.5.30.0100.00314.27
5.5.20.0030.00513.86
5.5.10.0100.00014.47
5.5.00.0000.00913.91

preferences:
50.61 ms | 401 KiB | 5 Q