3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Context { private $context = null; private $data = []; public function __construct(Context $context = null) { $this->context = $context; } public function get($name) { if (isset($this->data[$name])) { return $this->data[$name]; } if (isset($this->context)) { return $this->context->get($name); } return null; } public function getAll(array $names) { $data = []; foreach ($names as $name) { $data[$name] = $this->get($name); } return $data; } public function set($name, $value) { $this->data[$name] = $value; } public function wrap() { return new Context($this); } public function call(callable $function) { call_user_func($function, $this); } } (new Context)->call(function(Context $c) { $c->set('foo', 1); $c->set('bar', 2); $c->wrap()->call(function(Context $c) { $c->set('bar', 3); $c->set('qux', 4); $c->wrap()->call(function(Context $c) { $c->set('qux', 5); $c->set('zip', 6); var_dump($c->getAll(['foo', 'bar', 'qux', 'zip'])); }); var_dump($c->getAll(['foo', 'bar', 'qux', 'zip'])); }); var_dump($c->getAll(['foo', 'bar', 'qux', 'zip'])); });

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.0160.00618.35
8.3.50.0140.00421.98
8.3.40.0110.00618.67
8.3.30.0120.00319.21
8.3.20.0050.00320.33
8.3.10.0080.00021.92
8.3.00.0040.00422.52
8.2.180.0150.00325.92
8.2.170.0070.01319.08
8.2.160.0100.00322.96
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0020.00526.16
8.2.120.0050.00317.63
8.2.110.0090.00020.57
8.2.100.0120.00017.80
8.2.90.0060.00319.23
8.2.80.0000.00817.97
8.2.70.0030.00617.63
8.2.60.0060.00318.05
8.2.50.0050.00318.07
8.2.40.0070.00018.34
8.2.30.0020.00518.12
8.2.20.0040.00417.77
8.2.10.0090.00017.68
8.2.00.0070.00317.76
8.1.280.0150.00025.92
8.1.270.0030.00622.13
8.1.260.0040.00426.35
8.1.250.0150.00028.09
8.1.240.0000.00921.05
8.1.230.0150.00017.42
8.1.220.0030.00617.74
8.1.210.0030.00518.77
8.1.200.0040.00717.47
8.1.190.0060.00317.53
8.1.180.0060.00318.10
8.1.170.0060.00318.50
8.1.160.0000.00821.94
8.1.150.0000.00818.61
8.1.140.0070.00017.50
8.1.130.0000.00717.53
8.1.120.0040.00417.52
8.1.110.0050.00317.48
8.1.100.0050.00217.50
8.1.90.0090.00017.46
8.1.80.0000.00817.55
8.1.70.0000.00717.50
8.1.60.0000.00817.66
8.1.50.0040.00417.47
8.1.40.0000.00817.51
8.1.30.0030.00617.68
8.1.20.0060.00317.63
8.1.10.0040.00417.62
8.1.00.0040.00417.58
8.0.300.0080.00018.77
8.0.290.0070.00017.00
8.0.280.0000.00818.49
8.0.270.0030.00317.29
8.0.260.0030.00316.80
8.0.250.0030.00317.04
8.0.240.0070.00017.04
8.0.230.0030.00617.05
8.0.220.0030.00317.05
8.0.210.0030.00316.91
8.0.200.0000.00717.08
8.0.190.0040.00416.95
8.0.180.0040.00417.01
8.0.170.0040.00417.02
8.0.160.0030.00617.12
8.0.150.0030.00316.83
8.0.140.0030.00516.92
8.0.130.0060.00013.36
8.0.120.0060.00316.83
8.0.110.0040.00416.96
8.0.100.0040.00416.89
8.0.90.0000.00716.89
8.0.80.0060.01517.04
8.0.70.0000.00817.07
8.0.60.0000.00817.04
8.0.50.0050.00217.06
8.0.30.0130.00717.10
8.0.20.0090.01017.40
8.0.10.0000.00717.01
8.0.00.0070.01416.79
7.4.330.0000.00515.12
7.4.320.0070.00016.50
7.4.300.0060.00016.46
7.4.290.0030.00816.55
7.4.280.0000.00716.54
7.4.270.0030.00316.63
7.4.260.0000.01016.55
7.4.250.0040.00416.63
7.4.240.0000.00716.61
7.4.230.0000.00716.67
7.4.220.0120.00616.63
7.4.210.0100.00416.63
7.4.200.0000.00716.64
7.4.190.0070.00016.80
7.4.160.0060.01116.61
7.4.150.0210.00017.40
7.4.140.0140.00617.86
7.4.130.0110.00916.50
7.4.120.0080.01316.54
7.4.110.0130.01016.67
7.4.100.0140.01116.64
7.4.90.0110.00716.69
7.4.80.0110.00819.39
7.4.70.0030.01616.42
7.4.60.0120.00616.45
7.4.50.0040.00416.45
7.4.40.0070.01022.77
7.4.30.0070.01016.36
7.4.00.0060.01014.95
7.3.330.0050.00013.37
7.3.320.0050.00213.25
7.3.310.0030.00316.37
7.3.300.0030.00316.28
7.3.290.0060.00816.41
7.3.280.0090.00916.40
7.3.270.0100.00917.40
7.3.260.0090.00916.32
7.3.250.0110.00716.55
7.3.240.0120.01016.40
7.3.230.0180.00316.73
7.3.210.0090.00916.38
7.3.200.0120.01219.39
7.3.190.0110.01016.59
7.3.180.0040.01116.34
7.3.170.0140.00316.38
7.3.160.0030.01416.65
7.3.120.0090.00714.82
7.3.110.0130.00615.18
7.3.100.0070.01114.87
7.3.90.0040.00914.80
7.3.80.0000.00915.11
7.3.70.0030.00915.00
7.3.60.0030.00615.07
7.3.50.0100.00314.62
7.3.40.0050.00514.64
7.3.30.0100.00314.73
7.3.20.0070.00716.79
7.3.10.0110.01016.50
7.3.00.0120.00516.60
7.2.330.0160.00516.65
7.2.320.0140.01116.69
7.2.310.0040.01416.74
7.2.300.0150.00316.78
7.2.290.0090.00916.80
7.2.250.0070.01314.96
7.2.240.0030.01415.09
7.2.230.0140.00414.94
7.2.220.0100.00715.17
7.2.210.0130.00315.18
7.2.200.0030.00915.12
7.2.190.0060.00615.11
7.2.180.0000.01215.04
7.2.170.0030.00615.10
7.2.130.0140.00716.88
7.2.120.0140.00916.52
7.2.110.0060.01016.76
7.2.100.0120.00516.64
7.2.90.0060.01016.67
7.2.80.0090.00616.57
7.2.70.0030.01316.88
7.2.60.0130.01216.79
7.2.50.0150.00616.80
7.2.40.0110.01116.80
7.2.30.0100.01016.91
7.2.20.0090.00616.76
7.2.10.0120.00516.70
7.2.00.0060.00817.65
7.1.330.0040.01115.85
7.1.320.0040.01115.61
7.1.310.0090.00015.76
7.1.300.0070.00715.78
7.1.290.0060.00615.67
7.1.280.0090.00315.91
7.1.270.0060.00915.88
7.1.260.0060.00615.77
7.1.250.0000.01515.79
7.1.240.0100.00315.98
7.1.230.0000.01415.89
7.1.220.0100.00315.71
7.1.210.0140.00015.98
7.1.200.0070.00615.77
7.1.190.0040.00815.67
7.1.180.0040.01115.79
7.1.170.0070.00715.53
7.1.160.0070.00715.57
7.1.150.0070.00715.96
7.1.140.0030.00615.86
7.1.130.0050.00315.57
7.1.120.0030.00915.75
7.1.110.0040.01115.70
7.1.100.0080.00817.08
7.1.90.0060.00616.04
7.1.80.0140.00015.47
7.1.70.0020.00916.53
7.1.60.0070.00917.67
7.1.50.0100.00716.37
7.1.40.0070.00715.82
7.1.30.0070.00715.89
7.1.20.0060.00915.96
7.1.10.0060.00915.86
7.1.00.0060.04019.12
7.0.320.0070.00715.36
7.0.310.0070.00715.20
7.0.300.0030.01115.09
7.0.290.0120.00315.19
7.0.280.0060.00615.48
7.0.270.0020.00515.16
7.0.260.0100.00315.34
7.0.250.0040.00815.22
7.0.240.0070.00715.38
7.0.230.0100.00315.56
7.0.220.0000.01115.36
7.0.210.0030.01015.44
7.0.200.3060.00715.83
7.0.190.0080.00315.49
7.0.180.0080.00615.36
7.0.170.0060.00315.50
7.0.160.0060.00615.50
7.0.150.0090.00615.30
7.0.140.0090.03518.78
7.0.130.0060.00915.34
7.0.120.0070.00715.53
7.0.110.0130.00015.25
7.0.100.0030.03417.56
7.0.90.0050.02517.75
7.0.80.0060.02417.76
7.0.70.0040.02517.72
7.0.60.0000.02517.66
7.0.50.0120.02817.78
7.0.40.0060.02116.84
7.0.30.0070.04116.86
7.0.20.0050.04516.77
7.0.10.0090.04516.87
7.0.00.0030.04616.75
5.6.380.0030.01014.50
5.6.370.0030.01314.83
5.6.360.0060.01014.54
5.6.350.0030.00814.57
5.6.340.0070.00714.62
5.6.330.0060.00914.35
5.6.320.0070.00314.66
5.6.310.0060.00614.18
5.6.300.0080.00314.54
5.6.290.0000.00814.26
5.6.280.0020.04217.83
5.6.270.0100.00614.64
5.6.260.0030.00914.38
5.6.250.0020.03017.72
5.6.240.0000.02917.59
5.6.230.0110.03317.56
5.6.220.0030.02417.57
5.6.210.0020.02517.42
5.6.200.0050.02217.79
5.6.190.0110.02317.73
5.6.180.0060.02817.84
5.6.170.0050.02817.84
5.6.160.0080.04117.82
5.6.150.0080.04017.69
5.6.140.0020.04017.64
5.6.130.0070.04517.73
5.6.120.0100.04317.82
5.6.110.0030.04417.73
5.6.100.0050.03517.78
5.6.90.0130.03817.75
5.6.80.0000.04817.41
5.6.70.0070.05217.40
5.6.60.0060.02917.41
5.6.50.0060.04317.52
5.6.40.0050.04017.47
5.6.30.0150.03317.43
5.6.20.0080.04117.33
5.6.10.0100.02717.43
5.6.00.0080.04217.43
5.5.380.0040.02215.91
5.5.370.0050.01915.82
5.5.360.0000.03515.87
5.5.350.0020.02915.93
5.5.340.0060.02116.22
5.5.330.0050.02216.09
5.5.320.0050.02416.15
5.5.310.0050.04516.07
5.5.300.0050.04416.07
5.5.290.0090.03916.09
5.5.280.0080.04316.16
5.5.270.0040.02516.17
5.5.260.0130.03716.02
5.5.250.0060.03916.03
5.5.240.0050.04015.74
5.5.230.0050.04315.85
5.5.220.0090.03815.63
5.5.210.0050.03515.78
5.5.200.0070.04315.79
5.5.190.0060.04115.76
5.5.180.0030.04515.73
5.5.170.0070.00714.34
5.5.160.0060.04115.79
5.5.150.0120.02515.79
5.5.140.0030.03015.79
5.5.130.0060.04315.76
5.5.120.0070.03815.76
5.5.110.0050.04215.73
5.5.100.0070.03815.73
5.5.90.0050.04115.70
5.5.80.0100.03815.68
5.5.70.0020.04615.63
5.5.60.0070.03415.72
5.5.50.0080.03715.66
5.5.40.0090.03515.68
5.5.30.0070.03815.72
5.5.20.0020.04715.67
5.5.10.0080.03615.71
5.5.00.0040.04315.73
5.4.450.0070.03815.49
5.4.440.0110.03515.32
5.4.430.0070.03915.38
5.4.420.0110.03715.24
5.4.410.0100.03815.26
5.4.400.0100.03715.26
5.4.390.0080.04015.22
5.4.380.0100.03715.23
5.4.370.0060.02615.07
5.4.360.0050.03215.23
5.4.350.0090.03715.16
5.4.340.0090.03515.24
5.4.330.0030.00711.27
5.4.320.0040.03715.07
5.4.310.0050.04215.30
5.4.300.0050.02815.26
5.4.290.0030.04315.29
5.4.280.0080.03815.15
5.4.270.0050.04115.17
5.4.260.0050.02615.15
5.4.250.0080.03815.11
5.4.240.0060.03815.23
5.4.230.0050.04015.15
5.4.220.0070.04215.18
5.4.210.0040.04015.09
5.4.200.0030.04415.11
5.4.190.0040.03815.21
5.4.180.0100.03615.07
5.4.170.0030.02615.20
5.4.160.0120.02015.20
5.4.150.0020.02815.22
5.4.140.0050.03813.87
5.4.130.0050.03813.83
5.4.120.0070.03713.85
5.4.110.0040.04013.86
5.4.100.0120.03213.80
5.4.90.0030.04113.92
5.4.80.0030.04113.89
5.4.70.0030.03213.85
5.4.60.0070.03713.80
5.4.50.0050.04013.80
5.4.40.0070.02213.86
5.4.30.0040.03413.79
5.4.20.0060.03313.79
5.4.10.0030.04213.80
5.4.00.0080.03313.61
5.3.290.0030.04312.96
5.3.280.0050.03812.97
5.3.270.0040.04112.99
5.3.260.0060.04012.95
5.3.250.0030.04012.94
5.3.240.0070.03713.00
5.3.230.0110.03112.96
5.3.220.0020.04312.91
5.3.210.0060.04012.95
5.3.200.0050.03812.95
5.3.190.0080.04012.91
5.3.180.0060.03612.89
5.3.170.0050.03812.94
5.3.160.0080.03512.88
5.3.150.0070.03912.90
5.3.140.0040.03512.91
5.3.130.0060.03812.89
5.3.120.0060.04012.96
5.3.110.0040.04012.92
5.3.100.0030.05012.66
5.3.90.0100.03312.69
5.3.80.0050.04112.64
5.3.70.0070.03912.67
5.3.60.0030.03912.67
5.3.50.0020.04012.67
5.3.40.0030.04012.55
5.3.30.0060.02612.55
5.3.20.0050.03812.44
5.3.10.0040.03812.42
5.3.00.0040.03712.47
5.2.170.0050.03211.15
5.2.160.0030.03011.15
5.2.150.0070.03011.17
5.2.140.0000.03511.25
5.2.130.0030.03611.21
5.2.120.0030.02311.20
5.2.110.0020.01711.18
5.2.100.0070.02711.13
5.2.90.0000.03611.14
5.2.80.0020.03511.23
5.2.70.0060.03011.14
5.2.60.0070.02511.23
5.2.50.0050.03211.11
5.2.40.0010.02111.16
5.2.30.0070.03111.15
5.2.20.0030.03311.13
5.2.10.0050.03211.13
5.2.00.0030.03311.11
5.1.60.0030.03111.11
5.1.50.0060.02711.11
5.1.40.0020.03211.11
5.1.30.0100.02311.11
5.1.20.0070.02711.11
5.1.10.0070.02811.11
5.1.00.0050.02911.11
5.0.50.0070.01811.11
5.0.40.0030.01311.11
5.0.30.0030.03711.11
5.0.20.0020.02511.11
5.0.10.0030.02311.11
5.0.00.0030.03111.11
4.4.90.0030.01911.11
4.4.80.0030.01311.11
4.4.70.0020.02211.11
4.4.60.0000.02111.11
4.4.50.0020.01811.11
4.4.40.0050.02311.11
4.4.30.0020.01311.11
4.4.20.0020.01911.11
4.4.10.0030.01811.11
4.4.00.0040.02311.11
4.3.110.0050.01511.11
4.3.100.0020.02011.11
4.3.90.0060.01611.11
4.3.80.0060.01511.11
4.3.70.0030.01811.11
4.3.60.0030.01711.11
4.3.50.0030.01311.11
4.3.40.0020.02411.11
4.3.30.0020.01211.11
4.3.20.0020.01811.11
4.3.10.0000.02011.11
4.3.00.0040.01711.11

preferences:
49.76 ms | 401 KiB | 5 Q