3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Singleton { private static $instanciated = false; public function __construct() { if (self::$instanciated === true) { 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; } } class Factory { private $instance = null; public function getInstance() { if ($this->instance === null) { $this->instance = new Singleton(); } return $this->instance; } } $factory = new Factory(); $o = $factory->getInstance(); $o->set(5); $factory2 = new Factory(); $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.0110.00416.75
8.3.50.0070.01118.30
8.3.40.0080.00818.79
8.3.30.0110.00418.79
8.3.20.0100.00320.33
8.3.10.0000.00823.51
8.3.00.0030.00619.51
8.2.180.0070.01418.41
8.2.170.0110.00322.96
8.2.160.0070.00720.38
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0000.00826.16
8.2.120.0030.00617.50
8.2.110.0060.00322.16
8.2.100.0080.00417.93
8.2.90.0030.00619.21
8.2.80.0030.00617.97
8.2.70.0040.00417.50
8.2.60.0040.00418.03
8.2.50.0030.00618.07
8.2.40.0050.00319.38
8.2.30.0030.00520.51
8.2.20.0070.00017.63
8.2.10.0000.00817.89
8.2.00.0040.00418.07
8.1.280.0220.00025.92
8.1.270.0070.00323.76
8.1.260.0000.00826.35
8.1.250.0030.00628.09
8.1.240.0060.00322.66
8.1.230.0040.00717.66
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0060.00317.23
8.1.190.0000.00817.25
8.1.180.0000.00818.10
8.1.170.0040.00418.87
8.1.160.0050.00321.89
8.1.150.0030.00618.84
8.1.140.0030.00519.45
8.1.130.0070.00017.57
8.1.120.0050.00217.34
8.1.110.0030.00517.29
8.1.100.0040.00417.38
8.1.90.0040.00417.41
8.1.80.0030.00717.46
8.1.70.0000.00717.44
8.1.60.0060.00317.66
8.1.50.0080.00017.57
8.1.40.0030.00617.42
8.1.30.0000.00817.68
8.1.20.0050.00217.51
8.1.10.0030.00517.49
8.1.00.0040.00417.52
8.0.300.0080.00018.77
8.0.290.0040.00416.58
8.0.280.0080.00018.40
8.0.270.0030.00317.16
8.0.260.0070.00017.14
8.0.250.0000.00716.90
8.0.240.0030.00616.87
8.0.230.0070.00316.76
8.0.220.0000.00716.93
8.0.210.0000.00816.83
8.0.200.0030.00316.96
8.0.190.0030.00616.92
8.0.180.0030.00416.85
8.0.170.0040.00416.82
8.0.160.0070.00016.89
8.0.150.0030.00316.79
8.0.140.0030.00316.81
8.0.130.0030.00313.31
8.0.120.0050.00316.84
8.0.110.0000.00716.83
8.0.100.0070.00016.86
8.0.90.0040.00416.87
8.0.80.0080.00816.85
8.0.70.0040.00416.71
8.0.60.0000.00716.91
8.0.50.0000.00716.84
8.0.30.0100.01017.06
8.0.20.0080.01017.40
8.0.10.0040.00416.86
8.0.00.0090.00916.73
7.4.330.0050.00015.08
7.4.320.0030.00316.60
7.4.300.0000.00716.38
7.4.290.0030.00316.66
7.4.280.0000.00816.57
7.4.270.0000.00716.51
7.4.260.0030.00316.54
7.4.250.0000.00716.41
7.4.240.0030.00416.60
7.4.230.0000.00816.64
7.4.220.0080.01116.46
7.4.210.0100.00616.63
7.4.200.0030.00316.36
7.4.160.0040.01116.64
7.4.150.0180.00017.40
7.4.140.0120.01117.86
7.4.130.0060.01216.60
7.4.120.0070.01316.44
7.4.110.0060.01816.64
7.4.100.0140.00316.52
7.4.90.0070.01716.46
7.4.80.0090.01219.39
7.4.70.0060.00916.53
7.4.60.0120.00616.57
7.4.50.0050.00316.65
7.4.40.0090.00816.44
7.4.30.0340.01716.56
7.4.00.0110.00614.83
7.3.330.0000.00513.33
7.3.320.0000.00613.12
7.3.310.0000.00716.32
7.3.300.0070.00016.32
7.3.290.0050.00216.33
7.3.280.0080.01316.31
7.3.270.0100.00717.40
7.3.260.0090.00916.47
7.3.240.0120.00516.35
7.3.230.0000.01616.40
7.3.210.0100.00716.64
7.3.200.0160.00316.50
7.3.190.0120.00416.59
7.3.180.0130.00916.49
7.3.170.0110.00816.57
7.3.160.0110.00516.66
7.3.120.0070.01115.05
7.3.110.0100.01014.79
7.3.100.0100.00314.96
7.3.90.0030.01014.50
7.3.80.0090.00914.79
7.3.70.0000.01614.67
7.3.60.0040.00714.63
7.3.50.0080.00414.63
7.3.40.0120.00314.48
7.3.30.0000.01114.79
7.3.20.0060.00916.41
7.3.10.0060.00616.61
7.3.00.0050.00816.68
7.2.330.0060.01016.68
7.2.320.0170.00616.39
7.2.310.0000.01616.70
7.2.300.0070.01016.75
7.2.290.0110.00816.80
7.2.250.0100.01015.05
7.2.240.0090.00914.97
7.2.230.0030.01114.91
7.2.220.0000.00915.10
7.2.210.0070.00715.19
7.2.200.0090.00915.15
7.2.190.0000.01214.88
7.2.180.0000.01215.11
7.2.170.0030.01315.08
7.2.130.0070.00716.96
7.2.120.0050.00916.76
7.2.110.0000.00916.62
7.2.100.0050.00816.66
7.2.90.0110.00716.86
7.2.80.0000.01216.80
7.2.70.0000.01216.57
7.2.60.0030.01117.03
7.2.50.0090.00016.87
7.2.40.0000.00916.98
7.2.30.0140.00316.99
7.2.20.0030.01116.98
7.2.10.0060.00616.77
7.2.00.0070.00718.20
7.1.330.0080.00815.48
7.1.320.0030.00715.53
7.1.310.0140.00015.59
7.1.300.0060.01015.85
7.1.290.0000.01515.79
7.1.280.0030.01315.73
7.1.270.0070.00315.98
7.1.260.0090.00615.96
7.1.250.0060.00315.58
7.1.200.0030.01015.77
7.1.100.0090.00318.22
7.1.70.0000.00716.84
7.1.60.0060.01919.43
7.1.50.0040.01816.72
7.1.00.0070.07322.35
7.0.200.0240.00914.35
7.0.60.0070.03720.03
7.0.50.0030.04717.73
7.0.40.0070.04020.05
7.0.30.0470.07320.16
7.0.20.0370.04720.25
7.0.10.0100.03720.23
7.0.00.0070.04020.04
5.6.280.0000.07321.13
5.6.210.0130.03020.50
5.6.200.0030.08718.25
5.6.190.0030.06720.50
5.6.180.0330.07320.46
5.6.170.0300.07320.44
5.6.160.0000.05720.51
5.6.150.0170.07718.17
5.6.140.0100.05018.19
5.6.130.0100.08018.28
5.6.120.0100.07721.13
5.6.110.0030.09021.12
5.6.100.0100.05021.14
5.6.90.0100.08020.99
5.6.80.0130.05720.41
5.5.350.0200.03320.46
5.5.340.0130.06718.07
5.5.330.0030.06020.40
5.5.320.0230.04720.33
5.5.310.0330.05320.50
5.5.300.0070.04017.97
5.5.290.0030.07718.08
5.5.280.0100.03320.88
5.5.270.0070.04020.96
5.5.260.0030.04020.80
5.5.250.0100.08020.59
5.5.240.0100.08020.05
5.4.450.0400.05719.11
5.4.440.0330.07019.40
5.4.430.0330.06719.53
5.4.420.0300.06719.49
5.4.410.0300.07319.39
5.4.400.0130.06019.04
5.4.390.0270.04719.22
5.4.380.0270.04318.79
5.4.370.0170.05719.03
5.4.360.0230.06018.96
5.4.350.0270.03718.79
5.4.340.0070.07319.00
5.4.320.0300.06319.29
5.4.310.0500.03319.05
5.4.300.0270.07319.00
5.4.290.0200.07318.90
5.4.280.0270.07719.12
5.4.270.0400.06019.05
5.4.260.0200.05019.16
5.4.250.0300.05319.03
5.4.240.0200.06319.18
5.4.230.0230.04719.14
5.4.220.0470.05318.80
5.4.210.0400.05719.16
5.4.200.0470.05319.07
5.4.190.0830.05719.16
5.4.180.0830.06719.16
5.4.170.0970.07018.89
5.4.160.0530.04718.72
5.4.150.0100.06318.88
5.4.140.0130.05716.29
5.4.130.0030.06016.37
5.4.120.0230.04316.32
5.4.110.0130.05716.52
5.4.100.0200.04316.63
5.4.90.0200.03716.54
5.4.80.0100.05016.53
5.4.70.0200.05016.58
5.4.60.0200.05016.53
5.4.50.0170.05316.47
5.4.40.0300.04316.36
5.4.30.0000.06016.52
5.4.20.0070.05316.47
5.4.10.0170.06016.20
5.4.00.0300.05015.97

preferences:
44.2 ms | 400 KiB | 5 Q