3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Factory { private $instance = null; public function getInstance() { if ($this->instance === null) { $this->instance = new class() { 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; } }; } return $this->instance; } } $factory = new Factory(); $o = $factory->getInstance(); $o->set(5); $factory2 = new Factory(); // On s'attendrait à avoir une exception ici ... mais non $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.0090.00616.38
8.3.50.0130.00522.09
8.3.40.0150.00018.61
8.3.30.0140.00018.87
8.3.20.0000.00820.33
8.3.10.0000.00823.48
8.3.00.0060.00319.38
8.2.180.0080.00816.63
8.2.170.0180.00022.96
8.2.160.0100.00720.47
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0060.00320.52
8.2.120.0000.00826.35
8.2.110.0030.00722.08
8.2.100.0120.00017.93
8.2.90.0050.00219.21
8.2.80.0050.00317.97
8.2.70.0060.00617.63
8.2.60.0030.00618.03
8.2.50.0000.00918.07
8.2.40.0000.00719.34
8.2.30.0070.00020.69
8.2.20.0030.00617.54
8.2.10.0040.00417.94
8.2.00.0000.00817.94
8.1.280.0090.01225.92
8.1.270.0030.00623.96
8.1.260.0040.00428.09
8.1.250.0080.00028.09
8.1.240.0090.00022.54
8.1.230.0110.00017.66
8.1.220.0030.00617.75
8.1.210.0040.00418.77
8.1.200.0060.00317.47
8.1.190.0000.00817.48
8.1.180.0050.00318.10
8.1.170.0000.00818.66
8.1.160.0000.00822.10
8.1.150.0000.00718.89
8.1.140.0030.00519.46
8.1.130.0000.00717.71
8.1.120.0070.00017.52
8.1.110.0030.00617.48
8.1.100.0110.00017.36
8.1.90.0040.00417.54
8.1.80.0040.00417.50
8.1.70.0050.00317.50
8.1.60.0030.00617.68
8.1.50.0030.00617.43
8.1.40.0070.00317.54
8.1.30.0040.00417.65
8.1.20.0040.00417.53
8.1.10.0000.00717.57
8.1.00.0030.00617.59
8.0.300.0030.00518.77
8.0.290.0040.00416.63
8.0.280.0000.00718.46
8.0.270.0030.00317.21
8.0.260.0000.00617.32
8.0.250.0030.00317.04
8.0.240.0000.00716.95
8.0.230.0000.00717.01
8.0.220.0030.00316.89
8.0.210.0030.00316.81
8.0.200.0000.00616.89
8.0.190.0060.00316.86
8.0.180.0080.00017.01
8.0.170.0040.00416.96
8.0.160.0000.00816.87
8.0.150.0050.00316.81
8.0.140.0000.00716.85
8.0.130.0000.00613.34
8.0.120.0000.00716.91
8.0.110.0000.00816.81
8.0.100.0030.00516.96
8.0.90.0000.00716.78
8.0.80.0080.00816.79
8.0.70.0000.00716.84
8.0.60.0000.00816.82
8.0.50.0000.00816.70
8.0.30.0100.00717.13
8.0.20.0120.00617.40
8.0.10.0080.00017.06
8.0.00.0130.00616.80
7.4.330.0000.00516.79
7.4.320.0000.00816.52
7.4.300.0040.00416.54
7.4.290.0030.00316.51
7.4.280.0090.00016.54
7.4.270.0040.00416.67
7.4.260.0000.00716.58
7.4.250.0000.00716.57
7.4.240.0000.00716.52
7.4.230.0030.00316.60
7.4.220.0130.00616.46
7.4.210.0110.01116.54
7.4.200.0030.00316.43
7.4.160.0100.00516.57
7.4.150.0110.00717.40
7.4.140.0130.00717.86
7.4.130.0090.01216.57
7.4.120.0090.00916.50
7.4.110.0120.00616.63
7.4.100.0130.00316.64
7.4.90.0000.01716.63
7.4.80.0080.01319.39
7.4.70.0160.00016.52
7.4.60.0030.01416.46
7.4.50.0030.01316.57
7.4.40.0060.01016.48
7.4.30.0090.00616.61
7.4.00.0100.00315.00
7.3.330.0060.00013.18
7.3.320.0050.00013.38
7.3.310.0000.00816.29
7.3.300.0070.00016.23
7.3.290.0080.00816.28
7.3.280.0120.00916.31
7.3.270.0030.01317.40
7.3.260.0130.00516.43
7.3.250.0110.00716.37
7.3.240.0090.00816.52
7.3.230.0030.01416.39
7.3.210.0130.00916.53
7.3.200.0100.01016.41
7.3.190.0080.00816.44
7.3.180.0030.01316.45
7.3.170.0090.00916.43
7.3.160.0140.00316.34
7.2.330.0170.00716.87
7.2.320.0160.01016.79
7.2.310.0110.00516.70
7.2.300.0100.01316.62
7.2.290.0060.01116.66
7.2.60.0030.00716.78
7.1.200.0000.01015.84
7.1.100.0110.00017.98
7.1.70.0110.00416.95
7.1.60.0110.01419.36
7.1.50.0100.01416.74
7.1.00.0070.07322.54
7.0.200.0040.00716.55
7.0.60.0130.03019.90
7.0.50.0070.05717.98
7.0.40.0100.03720.26
7.0.30.0200.08020.23
7.0.20.0270.04720.19
7.0.10.0100.04020.25
7.0.00.0070.05020.06
5.6.280.0000.07320.93
5.6.210.0070.08020.71
5.6.200.0030.08318.20
5.6.190.0100.04020.77
5.6.180.0500.07020.35
5.6.170.0270.07320.50
5.6.160.0030.08720.71
5.6.150.0030.08718.16
5.6.140.0030.04018.21
5.6.130.0070.06718.24
5.6.120.0070.08321.05
5.6.110.0130.08020.99
5.6.100.0070.08721.13
5.6.90.0170.07021.08
5.6.80.0100.07720.48
5.5.350.0230.08320.50
5.5.340.0100.04017.98
5.5.330.0070.08320.57
5.5.320.0070.04720.51
5.5.310.0270.08020.23
5.5.300.0070.04317.95
5.5.290.0070.05318.01
5.5.280.0000.05720.98
5.5.270.0130.03720.89
5.5.260.0070.08320.88
5.5.250.0000.08020.55
5.5.240.0100.04020.12

preferences:
53.86 ms | 401 KiB | 5 Q