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 static 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 = new Foo(); $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.0060.00916.75
8.3.50.0120.00822.05
8.3.40.0000.01418.84
8.3.30.0180.00418.84
8.3.20.0070.00020.00
8.3.10.0000.00823.69
8.3.00.0000.00819.25
8.2.180.0090.00616.75
8.2.170.0120.00622.96
8.2.160.0110.00420.52
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0040.00817.50
8.2.120.0050.00326.35
8.2.110.0070.00319.21
8.2.100.0110.00017.97
8.2.90.0050.00319.17
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0100.00017.89
8.2.50.0040.00418.07
8.2.40.0000.00719.13
8.2.30.0000.00720.69
8.2.20.0050.00317.67
8.2.10.0000.00718.14
8.2.00.0040.00417.95
8.1.280.0030.01225.92
8.1.270.0040.00723.95
8.1.260.0050.00228.09
8.1.250.0000.00728.09
8.1.240.0060.00322.19
8.1.230.0070.00318.95
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0030.00617.11
8.1.190.0000.00917.13
8.1.180.0000.00918.10
8.1.170.0000.00818.71
8.1.160.0040.00421.94
8.1.150.0050.00318.89
8.1.140.0040.00419.52
8.1.130.0040.00417.71
8.1.120.0000.00717.30
8.1.110.0000.00717.36
8.1.100.0040.00417.31
8.1.90.0000.00717.32
8.1.80.0040.00417.42
8.1.70.0040.00417.34
8.1.60.0000.00817.55
8.1.50.0000.00817.36
8.1.40.0040.00417.39
8.1.30.0030.00617.54
8.1.20.0080.00317.53
8.1.10.0040.00417.52
8.1.00.0040.00817.39
8.0.300.0040.00418.77
8.0.290.0070.00016.75
8.0.280.0040.00418.55
8.0.270.0080.00017.27
8.0.260.0030.00317.26
8.0.250.0030.00316.93
8.0.240.0040.00417.00
8.0.230.0030.00316.95
8.0.220.0030.00416.87
8.0.210.0050.00316.88
8.0.200.0000.00616.93
8.0.190.0070.00017.00
8.0.180.0000.00716.88
8.0.170.0080.00017.05
8.0.160.0040.00416.94
8.0.150.0030.00616.97
8.0.140.0070.00016.94
8.0.130.0050.00013.33
8.0.120.0050.00316.83
8.0.110.0070.00016.96
8.0.100.0050.00316.88
8.0.90.0040.00417.02
8.0.80.0060.00917.02
8.0.70.0000.00717.00
8.0.60.0050.00316.79
8.0.50.0040.00417.09
8.0.30.0070.01216.98
8.0.20.0130.00817.40
8.0.10.0070.00016.92
8.0.00.0100.01116.85
7.4.330.0020.00216.83
7.4.320.0060.00016.47
7.4.300.0030.00316.60
7.4.290.0040.00416.44
7.4.280.0000.00816.49
7.4.270.0000.00716.36
7.4.260.0000.00816.52
7.4.250.0050.00316.52
7.4.240.0070.00016.55
7.4.230.0050.00216.64
7.4.220.0040.01416.48
7.4.210.0040.01116.46
7.4.200.0000.00716.25
7.4.160.0040.01516.34
7.4.150.0180.00317.40
7.4.140.0080.01417.86
7.4.130.0090.00716.60
7.4.120.0130.00516.64
7.4.110.0140.00916.54
7.4.100.0130.00516.73
7.4.90.0090.01116.34
7.4.80.0030.01319.39
7.4.70.0030.01516.44
7.4.60.0090.00816.51
7.4.50.0090.00916.44
7.4.40.0120.01216.47
7.4.30.0100.01316.66
7.4.00.0070.01014.94
7.3.330.0050.00013.17
7.3.320.0030.00313.13
7.3.310.0030.00316.35
7.3.300.0000.00716.36
7.3.290.0040.01116.27
7.3.280.0120.00416.30
7.3.270.0110.00517.40
7.3.260.0100.00716.57
7.3.250.0110.00516.46
7.3.240.0080.01116.28
7.3.230.0030.01416.47
7.3.210.0130.00316.41
7.3.200.0000.01816.40
7.3.190.0120.00616.29
7.3.180.0030.01716.45
7.3.170.0060.01216.39
7.3.160.0100.00816.46
7.2.330.0070.01416.38
7.2.320.0070.01616.35
7.2.310.0090.00616.24
7.2.300.0090.00916.68
7.2.290.0120.00916.53
7.2.60.0030.01316.46
7.2.00.0060.00919.32
7.1.200.0000.01515.79
7.1.100.0070.00318.31
7.1.70.0040.00417.05
7.1.60.0070.01719.48
7.1.50.0000.01516.96
7.1.00.0070.07322.43
7.0.200.0180.01114.85
7.0.60.0070.05720.02
7.0.50.0070.07717.86
7.0.40.0030.04320.11
7.0.30.0130.04720.23
7.0.20.0270.06720.23
7.0.10.0030.05020.26
7.0.00.0000.09320.05
5.6.280.0070.05321.05
5.6.210.0070.07720.73
5.6.200.0100.08018.23
5.6.190.0130.07020.50
5.6.180.0300.03020.63
5.6.170.0270.07320.47
5.6.160.0170.07720.45
5.6.150.0100.05018.28
5.6.140.0000.04018.18
5.6.130.0070.06318.30
5.6.120.0100.05321.16
5.6.110.0030.05021.00
5.6.100.0130.04320.98
5.6.90.0100.08320.98
5.6.80.0100.07320.41
5.5.350.0130.03720.45
5.5.340.0030.04017.97
5.5.330.0130.03720.29
5.5.320.0030.05320.32
5.5.310.0230.08020.34
5.5.300.0170.06718.08
5.5.290.0130.07717.96
5.5.280.0100.08720.79
5.5.270.0170.04720.68
5.5.260.0030.04320.88
5.5.250.0130.06320.59
5.5.240.0200.03720.16

preferences:
55.42 ms | 401 KiB | 5 Q