3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Container { protected $items; public function __construct() { $this->items = []; } public function exists($name) { return isset($this->item[$name]); } public function get($name) { if (!isset($this->item[$name])) { throw new RuntimeException('Item "' . $name . '" not found'); } return $this->item[$name]; } public function register($name, $item, $replace = false) { if (isset($this->item[$name]) and $replace === false) { throw new RuntimeException('Item "' . $name . '" already exists'); } $this->item[$name] = $item; return $this; } public function unregister($name) { if (!isset($this->item[$name])) { throw new RuntimeException('Item "' . $name . '" not found'); } unset($this->item[$name]); } } $container = new Container(); $container->register('object', new class(42) { private $value; public function __construct($value) { $this->value = $value; } public function value() { return $this->value; } }); $object = $container->get('object'); var_dump($object->value());

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.70.0120.00616.73
8.3.60.0150.00016.63
8.3.50.0120.01022.05
8.3.40.0090.00618.79
8.3.30.0130.00618.82
8.3.20.0080.00020.34
8.3.10.0000.00823.65
8.3.00.0000.00819.30
8.2.180.0120.00618.16
8.2.170.0140.00022.96
8.2.160.0130.00720.52
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0030.00617.63
8.2.120.0070.00026.35
8.2.110.0060.00320.46
8.2.100.0110.00018.05
8.2.90.0040.00419.21
8.2.80.0040.00417.97
8.2.70.0040.00417.61
8.2.60.0000.01118.05
8.2.50.0000.00818.07
8.2.40.0050.00319.29
8.2.30.0040.00420.68
8.2.20.0030.00617.82
8.2.10.0030.00518.01
8.2.00.0000.00718.05
8.1.280.0040.01225.92
8.1.270.0040.00423.91
8.1.260.0080.00028.09
8.1.250.0040.00428.09
8.1.240.0090.00022.64
8.1.230.0040.00717.65
8.1.220.0030.00617.74
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0000.00817.35
8.1.180.0020.00518.10
8.1.170.0030.00518.78
8.1.160.0040.00421.95
8.1.150.0040.00418.85
8.1.140.0000.00819.59
8.1.130.0070.00017.69
8.1.120.0000.00817.38
8.1.110.0000.00717.52
8.1.100.0050.00317.48
8.1.90.0000.00817.39
8.1.80.0030.00317.38
8.1.70.0040.00417.32
8.1.60.0030.00517.61
8.1.50.0000.00817.52
8.1.40.0000.00817.54
8.1.30.0060.00317.53
8.1.20.0060.00317.61
8.1.10.0000.00817.46
8.1.00.0080.00017.38
8.0.300.0040.00418.77
8.0.290.0060.00316.63
8.0.280.0030.00318.38
8.0.270.0000.00717.28
8.0.260.0030.00317.27
8.0.250.0030.00316.98
8.0.240.0030.00317.02
8.0.230.0040.00416.93
8.0.220.0070.00016.95
8.0.210.0000.00716.83
8.0.200.0030.00316.95
8.0.190.0000.00816.92
8.0.180.0040.00816.84
8.0.170.0050.00316.98
8.0.160.0040.00417.02
8.0.150.0000.00716.86
8.0.140.0030.00316.69
8.0.130.0000.00613.35
8.0.120.0030.00516.87
8.0.110.0030.00516.96
8.0.100.0000.00716.95
8.0.90.0040.00416.95
8.0.80.0090.00616.97
8.0.70.0040.00416.78
8.0.60.0030.00516.79
8.0.50.0000.00716.74
8.0.30.0160.00517.02
8.0.20.0110.00717.40
8.0.10.0040.00417.05
8.0.00.0070.01016.88
7.4.330.0050.00016.83
7.4.320.0000.00816.61
7.4.300.0030.00316.53
7.4.290.0030.00316.61
7.4.280.0070.00016.65
7.4.270.0000.00616.39
7.4.260.0030.00316.65
7.4.250.0040.00416.50
7.4.240.0060.00116.67
7.4.230.0030.00316.71
7.4.220.0090.00916.54
7.4.210.0160.00316.57
7.4.200.0040.00416.60
7.4.160.0080.00816.57
7.4.150.0000.01717.40
7.4.140.0100.00717.86
7.4.130.0080.00916.51
7.4.120.0060.01116.56
7.4.110.0170.00316.54
7.4.100.0110.00716.36
7.4.90.0090.00916.52
7.4.80.0120.00619.39
7.4.70.0030.01716.54
7.4.60.0030.01316.53
7.4.50.0120.00316.31
7.4.40.0140.00716.67
7.4.30.0070.01016.58
7.4.10.0040.01416.58
7.4.00.0060.00915.48
7.3.330.0000.00613.21
7.3.320.0030.00313.38
7.3.310.0030.00316.22
7.3.300.0060.00016.39
7.3.290.0080.00616.35
7.3.280.0100.00816.43
7.3.270.0070.01017.40
7.3.260.0100.00716.56
7.3.250.0110.00616.44
7.3.240.0070.01016.57
7.3.230.0090.00916.63
7.3.210.0030.01416.43
7.3.200.0090.00616.60
7.3.190.0130.01016.66
7.3.180.0100.00716.29
7.3.170.0120.00616.57
7.3.160.0160.00616.31
7.3.130.0120.00616.57
7.3.120.0130.00615.72
7.3.110.0090.00715.62
7.3.100.0080.00615.78
7.3.90.0080.00915.66
7.3.80.0050.00615.61
7.3.70.0020.00815.59
7.3.60.0070.00915.76
7.3.50.0070.01015.60
7.3.40.0020.00815.54
7.3.30.0040.01115.59
7.3.20.0070.00717.46
7.3.10.0080.00717.16
7.3.00.0050.00816.89
7.2.330.0090.01716.80
7.2.320.0060.01616.39
7.2.310.0130.00316.43
7.2.300.0060.01316.82
7.2.290.0070.01416.63
7.2.260.0030.01616.46
7.2.250.0070.01015.69
7.2.240.0110.00615.82
7.2.230.0060.00815.98
7.2.220.0090.00716.02
7.2.210.0070.01015.75
7.2.200.0080.00715.78
7.2.190.0060.01015.75
7.2.180.0050.00515.85
7.2.170.0100.00515.86
7.2.160.0060.00616.61
7.2.150.0060.01018.27
7.2.140.0100.00318.38
7.2.130.0020.01017.36
7.2.120.0080.00617.41
7.2.110.0060.00517.54
7.2.100.0050.00917.46
7.2.90.0090.00417.38
7.2.80.0040.01117.34
7.2.70.0070.00417.22
7.2.60.0060.00717.27
7.2.50.0050.00817.45
7.2.40.0040.00917.50
7.2.30.0050.01117.42
7.2.20.0070.00517.30
7.2.10.0070.00817.50
7.2.00.0050.00917.84
7.1.330.0070.00616.50
7.1.320.0030.01016.60
7.1.310.0050.01016.53
7.1.300.0100.00716.49
7.1.290.0050.00716.57
7.1.280.0050.01016.63
7.1.270.0060.00816.62
7.1.260.0110.00216.55
7.1.250.0080.00516.40
7.1.240.0020.00816.55
7.1.230.0050.00716.69
7.1.220.0090.00316.58
7.1.210.0020.00916.63
7.1.200.0080.00516.27
7.1.190.0080.00416.47
7.1.180.0050.00616.66
7.1.170.0050.00716.51
7.1.160.0080.00616.60
7.1.150.0110.00616.53
7.1.140.0060.00516.54
7.1.130.0050.00816.68
7.1.120.0060.00616.57
7.1.110.0040.00716.56
7.1.100.0060.00717.08
7.1.90.0060.00616.79
7.1.80.0100.00416.60
7.1.70.0050.00816.80
7.1.60.0090.00917.47
7.1.50.0060.01016.74
7.1.40.0030.01016.64
7.1.30.0070.00716.50
7.1.20.0050.00516.58
7.1.10.0060.00816.50
7.1.00.0040.03118.39
7.0.330.0060.00616.14
7.0.320.0050.00616.16
7.0.310.0060.00616.10
7.0.300.0040.00916.20
7.0.290.0040.01016.18
7.0.280.0040.00916.08
7.0.270.0060.00416.19
7.0.260.0060.00616.15
7.0.250.0060.00616.33
7.0.240.0110.00216.18
7.0.230.0030.00716.30
7.0.220.0080.00716.11
7.0.210.0060.01016.18
7.0.200.0080.00515.85
7.0.190.0070.00716.06
7.0.180.0050.00816.30
7.0.170.0030.00916.28
7.0.160.0060.00716.26
7.0.150.0050.00916.14
7.0.140.0050.00716.21
7.0.130.0060.01016.08
7.0.120.0030.01016.34
7.0.110.0040.00916.14
7.0.100.0030.01016.30
7.0.90.0070.01116.19
7.0.80.0080.00316.16
7.0.70.0050.00916.09
7.0.60.0040.01917.33
7.0.50.0060.01916.77
7.0.40.0070.03316.21
7.0.30.0090.02816.10
7.0.20.0090.01916.19
7.0.10.0090.02816.20
7.0.00.0070.03316.29
5.6.400.0000.01215.66
5.6.390.0040.00815.73
5.6.380.0040.00714.88
5.6.370.0050.00815.00
5.6.360.0060.00614.85
5.6.350.0030.00914.76
5.6.340.0080.00514.76
5.6.330.0060.00514.88
5.6.320.0070.00714.87
5.6.310.0110.00614.91
5.6.300.0060.00614.88
5.6.290.0050.00914.99
5.6.280.0020.02116.90
5.6.270.0080.00514.80
5.6.260.0040.00914.84
5.6.250.0040.01014.84
5.6.240.0050.00914.64
5.6.230.0020.00914.69
5.6.220.0070.00714.66
5.6.210.0020.02916.74
5.6.200.0030.02015.92
5.6.190.0060.01916.51
5.6.180.0130.02616.62
5.6.170.0130.03016.74
5.6.160.0070.03316.62
5.6.150.0040.02415.93
5.6.140.0070.01516.02
5.6.130.0060.03116.03
5.6.120.0070.03116.85
5.6.110.0080.02816.82
5.6.100.0050.02216.78
5.6.90.0030.02016.82
5.6.80.0080.02616.53
5.6.70.0050.00814.57
5.6.60.0050.01014.79
5.6.50.0020.01114.88
5.6.40.0030.01114.55
5.6.30.0060.00614.73
5.6.20.0080.00514.80
5.6.10.0110.00314.54
5.6.00.0030.01114.82
5.5.380.0050.00613.52
5.5.370.0030.00813.52
5.5.360.0080.00513.48
5.5.350.0140.02915.81
5.5.340.0050.03115.07
5.5.330.0090.02615.75
5.5.320.0060.01715.84
5.5.310.0110.03215.83
5.5.300.0060.03114.98
5.5.290.0030.02015.15
5.5.280.0100.02816.01
5.5.270.0080.02715.87
5.5.260.0050.02016.05
5.5.250.0060.03115.86
5.5.240.0090.01415.82
5.5.230.0050.00513.46
5.5.220.0040.00613.52
5.5.210.0050.00713.54
5.5.200.0030.00513.51
5.5.190.0040.00613.51
5.5.180.0030.00613.54
5.5.170.0050.00613.57
5.5.160.0070.00713.45
5.5.150.0030.00813.67
5.5.140.0050.00613.52
5.5.130.0080.00113.59
5.5.120.0050.00713.52
5.5.110.0050.00713.66
5.5.100.0020.00813.57
5.5.90.0030.00713.55
5.5.80.0040.01013.54
5.5.70.0060.00413.54
5.5.60.0040.00513.57
5.5.50.0060.00613.50
5.5.40.0080.00113.52
5.5.30.0030.01013.52
5.5.20.0050.00513.47
5.5.10.0030.00713.47
5.5.00.0030.00713.55

preferences:
52.35 ms | 401 KiB | 5 Q