3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Musket { private static $instanciated = false; private $var; public function __construct() { if (self::$instanciated === true) { throw new RuntimeException('Could not instanciate class'); } self::$instanciated = true; } // Interdiction du clonage private function __clone() { } 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 Musket(); } return $this->instance; } } $factory = new Factory(); $o = $factory->getInstance(); $o->set(5);

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.0100.01016.50
8.3.50.0070.01118.31
8.3.40.0070.00718.75
8.3.30.0030.01218.71
8.3.20.0050.00320.24
8.3.10.0080.00021.83
8.3.00.0090.00019.38
8.2.180.0110.00716.50
8.2.170.0110.01122.96
8.2.160.0070.00722.08
8.2.150.0070.00024.18
8.2.140.0070.00024.66
8.2.130.0040.00417.48
8.2.120.0070.00026.35
8.2.110.0090.00022.13
8.2.100.0060.00617.93
8.2.90.0040.00419.28
8.2.80.0040.00717.97
8.2.70.0030.00617.75
8.2.60.0030.00717.92
8.2.50.0030.00518.07
8.2.40.0000.00719.52
8.2.30.0040.00420.50
8.2.20.0030.00617.55
8.2.10.0040.00418.06
8.2.00.0000.00718.00
8.1.280.0040.01525.92
8.1.270.0040.00423.95
8.1.260.0000.00828.09
8.1.250.0000.00828.09
8.1.240.0030.00622.52
8.1.230.0060.00617.53
8.1.220.0050.00317.74
8.1.210.0080.00018.77
8.1.200.0090.00017.38
8.1.190.0050.00317.00
8.1.180.0080.00018.10
8.1.170.0040.00420.11
8.1.160.0000.00721.94
8.1.150.0000.00818.77
8.1.140.0030.00619.56
8.1.130.0000.00717.69
8.1.120.0000.00717.40
8.1.110.0040.00417.40
8.1.100.0040.00417.36
8.1.90.0000.00817.32
8.1.80.0000.00817.32
8.1.70.0030.00317.32
8.1.60.0040.00417.60
8.1.50.0040.00417.41
8.1.40.0030.00617.51
8.1.30.0040.00417.57
8.1.20.0040.00417.66
8.1.10.0040.00417.55
8.1.00.0050.00317.50
8.0.300.0050.00318.77
8.0.290.0000.00716.63
8.0.280.0030.00318.29
8.0.270.0000.00817.07
8.0.260.0030.00317.20
8.0.250.0000.00816.95
8.0.240.0030.00516.88
8.0.230.0000.00816.92
8.0.220.0030.00316.83
8.0.210.0050.00316.75
8.0.200.0030.00316.77
8.0.190.0070.00016.92
8.0.180.0000.00716.77
8.0.170.0000.00816.88
8.0.160.0000.00716.91
8.0.150.0040.00416.76
8.0.140.0100.00016.77
8.0.130.0000.00713.17
8.0.120.0040.00416.81
8.0.110.0000.00716.80
8.0.100.0000.00716.80
8.0.90.0070.00016.84
8.0.80.0040.01116.74
8.0.70.0000.00716.65
8.0.60.0040.00416.88
8.0.50.0040.00416.70
8.0.30.0110.00717.07
8.0.20.0100.00817.40
8.0.10.0070.00016.82
8.0.00.0090.00716.83
7.4.330.0000.00516.84
7.4.320.0000.00716.41
7.4.300.0000.00616.55
7.4.290.0000.00816.41
7.4.280.0050.00316.45
7.4.270.0040.00416.50
7.4.260.0000.00716.52
7.4.250.0070.00016.38
7.4.240.0000.00716.49
7.4.230.0000.00716.49
7.4.220.0090.00916.63
7.4.210.0130.00316.55
7.4.200.0040.00416.58
7.4.160.0090.00616.50
7.4.150.0070.01017.40
7.4.140.0110.00817.86
7.4.130.0040.01316.50
7.4.120.0160.00616.57
7.4.110.0150.00316.50
7.4.100.0090.01216.49
7.4.90.0080.00916.54
7.4.80.0090.01119.39
7.4.70.0040.01416.39
7.4.60.0060.01016.61
7.4.50.0070.01016.38
7.4.40.0080.00816.48
7.4.30.0060.01216.46
7.4.00.0000.01514.91
7.3.330.0060.00013.29
7.3.320.0050.00013.29
7.3.310.0030.00316.16
7.3.300.0000.00716.35
7.3.290.0000.00816.27
7.3.280.0100.00816.30
7.3.270.0030.01317.40
7.3.260.0030.01516.30
7.3.250.0110.00716.48
7.3.240.0080.00916.43
7.3.230.0120.00616.39
7.3.210.0000.01616.35
7.3.200.0110.00616.39
7.3.190.0150.00316.43
7.3.180.0100.00616.34
7.3.170.0100.00716.34
7.3.160.0080.00716.47
7.2.330.0090.00916.46
7.2.320.0130.00316.58
7.2.310.0060.01016.43
7.2.300.0060.01216.84
7.2.290.0100.01316.71
7.2.60.0070.00716.92
7.2.00.0140.01219.15
7.1.200.0090.00315.91
7.1.100.0030.00718.14
7.1.70.0060.00917.01
7.1.60.0090.01619.48
7.1.50.0060.01016.84
7.1.00.0070.07322.30
7.0.200.0100.00814.75
7.0.60.0030.09320.04
7.0.50.0070.06317.89
7.0.40.0070.05320.11
7.0.30.0200.05720.26
7.0.20.0330.07020.09
7.0.10.0100.08320.15
7.0.00.0070.04320.05
5.6.280.0070.04721.03
5.6.210.0170.07720.76
5.6.200.0100.05018.14
5.6.190.0070.04720.48
5.6.180.0330.08020.54
5.6.170.0400.07020.51
5.6.160.0070.08320.50
5.6.150.0100.03318.22
5.6.140.0130.08318.15
5.6.130.0100.07018.18
5.6.120.0070.08721.09
5.6.110.0070.07720.96
5.6.100.0100.08321.12
5.6.90.0030.04021.00
5.6.80.0030.08320.38
5.5.350.4470.04320.38
5.5.340.0100.07718.04
5.5.330.0070.07720.35
5.5.320.0270.07720.42
5.5.310.0370.06720.30
5.5.300.0070.08017.93
5.5.290.0130.05717.98
5.5.280.0130.03320.99
5.5.270.0030.04720.87
5.5.260.0170.07720.93
5.5.250.0030.04320.62
5.5.240.0270.07320.24

preferences:
74.84 ms | 401 KiB | 5 Q