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; 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.0140.00416.75
8.3.50.0100.01022.11
8.3.40.0150.00018.74
8.3.30.0110.00418.75
8.3.20.0000.00720.52
8.3.10.0000.00823.36
8.3.00.0080.00019.50
8.2.180.0150.00616.63
8.2.170.0120.00622.96
8.2.160.0100.00719.49
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0030.00719.23
8.2.120.0000.00926.35
8.2.110.0060.00320.95
8.2.100.0040.00717.84
8.2.90.0040.00417.91
8.2.80.0000.00817.97
8.2.70.0050.00317.63
8.2.60.0040.00417.92
8.2.50.0040.00418.07
8.2.40.0050.00319.34
8.2.30.0050.00320.70
8.2.20.0090.00017.83
8.2.10.0040.00417.96
8.2.00.0040.00417.95
8.1.280.0060.00925.92
8.1.270.0070.00423.88
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0030.00622.53
8.1.230.0110.00020.85
8.1.220.0040.00417.77
8.1.210.0040.00418.85
8.1.200.0030.00617.35
8.1.190.0050.00317.23
8.1.180.0040.00418.10
8.1.170.0000.00820.38
8.1.160.0000.00721.95
8.1.150.0000.00718.91
8.1.140.0080.00019.44
8.1.130.0000.00717.58
8.1.120.0000.00817.46
8.1.110.0000.00817.39
8.1.100.0040.00417.47
8.1.90.0030.00517.44
8.1.80.0040.00417.42
8.1.70.0070.00017.29
8.1.60.0040.00417.53
8.1.50.0000.00817.39
8.1.40.0040.00417.51
8.1.30.0070.00317.61
8.1.20.0120.00017.48
8.1.10.0040.00417.39
8.1.00.0090.00317.44
8.0.300.0040.00419.74
8.0.290.0040.00416.75
8.0.280.0030.00318.46
8.0.270.0000.00717.28
8.0.260.0070.00017.21
8.0.250.0070.00017.02
8.0.240.0030.00317.02
8.0.230.0030.00317.02
8.0.220.0000.00716.98
8.0.210.0030.00316.96
8.0.200.0070.00016.96
8.0.190.0040.00416.91
8.0.180.0000.00816.90
8.0.170.0040.00416.88
8.0.160.0060.00316.95
8.0.150.0000.00716.88
8.0.140.0070.00016.94
8.0.130.0030.00313.35
8.0.120.0040.00416.95
8.0.110.0000.00717.01
8.0.100.0050.00216.98
8.0.90.0050.00316.83
8.0.80.0090.00917.02
8.0.70.0040.00416.77
8.0.60.0070.00016.97
8.0.50.0050.00216.86
8.0.30.0070.01017.03
8.0.20.0090.00917.40
8.0.10.0080.00016.96
8.0.00.0090.01116.85
7.4.330.0050.00016.67
7.4.320.0070.00016.61
7.4.300.0030.00316.59
7.4.290.0030.00316.52
7.4.280.0050.00316.54
7.4.270.0070.00016.61
7.4.260.0070.00016.63
7.4.250.0040.00416.58
7.4.240.0020.00516.51
7.4.230.0030.00316.35
7.4.220.0060.01316.41
7.4.210.0070.01016.59
7.4.200.0070.00016.71
7.4.160.0070.01016.57
7.4.150.0060.01217.40
7.4.140.0150.00517.86
7.4.130.0100.00816.59
7.4.120.0080.01316.59
7.4.110.0100.01016.52
7.4.100.0090.00816.62
7.4.90.0080.01516.61
7.4.80.0100.01419.39
7.4.70.0070.01016.41
7.4.60.0100.00716.68
7.4.50.0030.01016.72
7.4.40.0070.01016.58
7.4.30.0170.00316.53
7.4.00.0060.01015.19
7.3.330.0000.00513.45
7.3.320.0020.00213.20
7.3.310.0000.00716.38
7.3.300.0000.00716.25
7.3.290.0100.00816.33
7.3.280.0130.00816.39
7.3.270.0160.01317.40
7.3.260.0090.00916.48
7.3.250.0070.01016.50
7.3.240.0070.01216.33
7.3.230.0170.00316.56
7.3.210.0070.01016.41
7.3.200.0060.00916.54
7.3.190.0190.00316.45
7.3.180.0100.00616.36
7.3.170.0030.01316.47
7.3.160.0120.01016.34
7.2.330.0080.00916.78
7.2.320.0130.00716.75
7.2.310.0120.00316.39
7.2.300.0080.00816.75
7.2.290.0140.01116.29
7.2.80.0030.01216.71
7.2.60.0030.01016.82
7.2.50.0000.01417.12
7.1.200.0000.01515.56
7.1.70.0000.00717.32
7.1.60.0030.00717.23
7.1.50.0070.01616.87
7.1.00.0000.08022.32
7.0.200.0060.01216.73
7.0.60.0030.04019.95
7.0.50.0070.07317.89
7.0.40.0030.07020.24
7.0.30.0170.04320.10
7.0.20.0270.05320.12
7.0.10.0070.04320.20
7.0.00.0170.07320.06
5.6.210.0070.04720.63
5.6.200.0030.09018.16
5.6.190.0100.07320.61
5.6.180.0300.04720.57
5.6.170.0230.08320.50
5.6.160.0070.05320.55
5.6.150.0100.07018.29
5.6.140.0270.03318.18
5.6.130.0030.07018.23
5.6.120.0100.08321.14
5.6.110.0070.04321.02
5.6.100.0100.07021.14
5.6.90.0030.05020.98
5.6.80.0070.08320.40
5.5.350.0230.04720.45
5.5.340.0130.07717.99
5.5.330.0130.05720.25
5.5.320.0070.08020.25
5.5.310.0170.06320.26
5.5.300.0030.04017.97
5.5.290.0070.08018.10
5.5.280.0070.08320.78
5.5.270.0070.08320.97
5.5.260.0070.07320.74
5.5.250.0030.07020.70
5.5.240.0270.07320.25

preferences:
31.12 ms | 401 KiB | 5 Q