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()); }); var_dump($c->getAll()); }); var_dump($c->getAll()); });

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.0130.00318.80
8.3.50.0120.01022.04
8.3.40.0070.00719.04
8.3.30.0090.00619.21
8.3.20.0040.00420.36
8.3.10.0080.00023.65
8.3.00.0040.00422.43
8.2.180.0180.00316.75
8.2.170.0150.00022.96
8.2.160.0110.00322.11
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0030.00526.16
8.2.120.0040.00419.63
8.2.110.0060.00321.98
8.2.100.0080.00417.84
8.2.90.0040.00419.26
8.2.80.0000.00818.05
8.2.70.0100.00017.62
8.2.60.0050.00318.04
8.2.50.0050.00318.07
8.2.40.0000.00818.28
8.2.30.0000.00818.14
8.2.20.0030.00517.80
8.2.10.0030.00617.72
8.2.00.0000.00717.72
8.1.280.0140.00025.92
8.1.270.0090.00023.80
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.70
8.1.230.0120.00019.08
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0000.00817.63
8.1.180.0080.00018.10
8.1.170.0050.00318.62
8.1.160.0040.00422.07
8.1.150.0000.00818.53
8.1.140.0080.00317.44
8.1.130.0080.00017.72
8.1.120.0000.00817.45
8.1.110.0040.00417.47
8.1.100.0000.00717.40
8.1.90.0000.00817.54
8.1.80.0050.00317.40
8.1.70.0040.00417.46
8.1.60.0000.00817.61
8.1.50.0000.00817.49
8.1.40.0050.00317.59
8.1.30.0040.00417.51
8.1.20.0030.00517.70
8.1.10.0000.00717.64
8.1.00.0040.00417.45
8.0.300.0040.00418.77
8.0.290.0080.00016.93
8.0.280.0030.00318.33
8.0.270.0030.00317.17
8.0.260.0030.00716.84
8.0.250.0030.00316.99
8.0.240.0000.00716.94
8.0.230.0030.00316.97
8.0.220.0070.00016.90
8.0.210.0070.00016.92
8.0.200.0000.00817.05
8.0.190.0040.00417.05
8.0.180.0060.00616.90
8.0.170.0030.00517.04
8.0.160.0040.00417.04
8.0.150.0030.00316.94
8.0.140.0000.00716.85
8.0.130.0030.00313.38
8.0.120.0030.00517.07
8.0.110.0040.00416.93
8.0.100.0040.00417.05
8.0.90.0040.00316.82
8.0.80.0030.01916.93
8.0.70.0000.00816.86
8.0.60.0030.00516.82
8.0.50.0000.00817.04
8.0.30.0120.01317.10
8.0.20.0110.00817.40
8.0.10.0050.00317.10
8.0.00.0090.01016.90
7.4.330.0060.00015.20
7.4.320.0030.00316.63
7.4.300.0030.00316.61
7.4.290.0030.00316.43
7.4.280.0040.00416.54
7.4.270.0030.00316.63
7.4.260.0000.00716.38
7.4.250.0020.00516.53
7.4.240.0040.00416.63
7.4.230.0070.00016.29
7.4.220.0070.01016.48
7.4.210.0070.00716.60
7.4.200.0030.00516.38
7.4.190.0050.00216.77
7.4.160.0090.00616.36
7.4.150.0170.00017.40
7.4.140.0110.00917.86
7.4.130.0090.00816.46
7.4.120.0120.01016.68
7.4.110.0030.01316.54
7.4.100.0110.01116.66
7.4.90.0030.01416.55
7.4.80.0070.01119.39
7.4.70.0120.01116.46
7.4.60.0060.00916.70
7.4.50.0040.00016.64
7.4.40.0070.00722.77
7.4.30.0120.00616.63
7.4.10.0070.01015.14
7.4.00.0060.01115.17
7.3.330.0050.00013.29
7.3.320.0030.00213.48
7.3.310.0000.00716.45
7.3.300.0020.00516.41
7.3.290.0000.01516.48
7.3.280.0080.01016.46
7.3.270.0060.01217.40
7.3.260.0110.00716.60
7.3.250.0150.00516.54
7.3.240.0120.00616.62
7.3.230.0120.00616.56
7.3.210.0130.00316.39
7.3.200.0100.01316.75
7.3.190.0100.01016.53
7.3.180.0090.00616.54
7.3.170.0130.00316.38
7.3.160.0080.01316.62
7.3.130.0060.00614.89
7.3.120.0060.01114.99
7.3.110.0100.00914.73
7.3.100.0040.00814.91
7.3.90.0070.00815.02
7.3.80.0060.00414.92
7.3.70.0070.00714.89
7.3.60.0050.00814.95
7.3.50.0070.00514.85
7.3.40.0030.00914.91
7.3.30.0040.01214.92
7.3.20.0090.00516.64
7.3.10.0080.00716.62
7.3.00.0030.01016.70
7.2.330.0070.01116.60
7.2.320.0070.01116.82
7.2.310.0070.01016.80
7.2.300.0100.01016.41
7.2.290.0070.01016.76
7.2.260.0080.01114.89
7.2.250.0060.01215.16
7.2.240.0050.01314.92
7.2.230.0080.00515.15
7.2.220.0030.00914.86
7.2.210.0080.00615.01
7.2.200.0040.00814.99
7.2.190.0070.00715.01
7.2.180.0080.00615.09
7.2.170.0080.00815.02
7.2.160.0040.01515.04
7.2.150.0030.01016.88
7.2.140.0040.00817.00
7.2.130.0080.00716.85
7.2.120.0060.00716.82
7.2.110.0080.00316.71
7.2.100.0100.00316.73
7.2.90.0080.01016.89
7.2.80.0050.01116.93
7.2.70.0090.00916.87
7.2.60.0040.00816.85
7.2.50.0070.00916.75
7.2.40.0050.01016.90
7.2.30.0020.00816.95
7.2.20.0030.01016.83
7.2.10.0050.00916.69
7.2.00.0030.00917.61
7.1.330.0040.01115.71
7.1.320.0050.00815.82
7.1.310.0020.01015.88
7.1.300.0030.01115.95
7.1.290.0060.00815.71
7.1.280.0060.00715.74
7.1.270.0050.00915.71
7.1.260.0060.00715.85
7.1.250.0070.00915.89
7.1.240.0060.00915.99
7.1.230.0090.00215.75
7.1.220.0080.00515.55
7.1.210.0110.00115.91
7.1.200.0060.00915.80
7.1.190.0080.00715.64
7.1.180.0030.00715.81
7.1.170.0050.00615.91
7.1.160.0070.00815.58
7.1.150.0010.01015.64
7.1.140.0050.00915.97
7.1.130.0050.00715.78
7.1.120.0020.01115.71
7.1.110.0070.00515.78
7.1.100.0060.00716.65
7.1.90.0030.01015.76
7.1.80.0020.01115.74
7.1.70.0060.00816.14
7.1.60.0020.01416.90
7.1.50.0100.01121.96
7.1.40.0020.00715.77
7.1.30.0050.00815.68
7.1.20.0010.00915.70
7.1.10.0060.00515.73
7.1.00.0050.02917.85
7.0.330.0070.00715.31
7.0.320.0060.00915.13
7.0.310.0100.00415.19
7.0.300.0050.00615.32
7.0.290.0070.00515.35
7.0.280.0050.00715.46
7.0.270.0050.00515.33
7.0.260.0060.00515.20
7.0.250.0060.00615.43
7.0.240.0050.00815.36
7.0.230.0060.00615.30
7.0.220.0040.00715.36
7.0.210.0100.00515.23
7.0.200.0070.00615.94
7.0.190.0050.00715.53
7.0.180.0030.01115.30
7.0.170.0080.00615.46
7.0.160.0040.00415.49
7.0.150.0050.00715.42
7.0.140.0060.02717.59
7.0.130.0080.00315.40
7.0.120.0070.00615.54
7.0.110.0020.01215.54
7.0.100.0030.00615.44
7.0.90.0020.00915.39
7.0.80.0050.00415.38
7.0.70.0070.00615.22
7.0.60.0030.03316.93
7.0.50.0070.02016.28
7.0.40.0020.02115.61
7.0.30.0100.03015.76
7.0.20.0140.01615.76
7.0.10.0040.03315.70
7.0.00.0080.01915.66
5.6.400.0090.00614.45
5.6.390.0090.00914.32
5.6.380.0080.00514.42
5.6.370.0060.01014.51
5.6.360.0030.00914.44
5.6.350.0060.00514.50
5.6.340.0030.00714.61
5.6.330.0020.01014.50
5.6.320.0060.00414.26
5.6.310.0050.01014.58
5.6.300.0050.00814.43
5.6.290.0030.00714.53
5.6.280.0050.02716.63
5.6.270.0010.00814.45
5.6.260.0020.01114.58
5.6.250.0070.00714.51
5.6.240.0010.01014.35
5.6.230.0050.00714.56
5.6.220.0070.01014.16
5.6.210.0090.02916.29
5.6.200.0070.01615.72
5.6.190.0040.02216.44
5.6.180.0090.03016.39
5.6.170.0150.02016.33
5.6.160.0040.01916.39
5.6.150.0030.01915.68
5.6.140.0070.03115.58
5.6.130.0060.03115.71
5.6.120.0080.02616.69
5.6.110.0060.03816.64
5.6.100.0070.03016.53
5.6.90.0100.03116.53
5.6.80.0100.02616.33
5.6.70.1580.01816.15
5.6.60.0020.00714.29
5.6.50.0050.00714.19
5.6.40.0020.00914.19
5.6.30.0030.00814.41
5.6.20.0050.00714.22
5.6.10.0070.00514.26
5.6.00.0020.01114.22
5.5.380.0090.00312.88
5.5.370.0080.00412.84
5.5.360.0040.00512.74
5.5.350.0030.03115.31
5.5.340.0060.02914.46
5.5.330.0060.03015.34
5.5.320.0120.03015.22
5.5.310.0080.01615.33
5.5.300.0070.01814.52
5.5.290.0060.02314.61
5.5.280.0060.03015.57
5.5.270.0030.03715.39
5.5.260.0060.03215.29
5.5.250.0040.01915.37
5.5.240.0030.03215.35
5.5.230.0090.00412.68
5.5.220.0050.00712.51
5.5.210.0050.00512.67
5.5.200.0060.00512.81
5.5.190.0040.00912.80
5.5.180.0060.00412.34
5.5.170.0080.00312.76
5.5.160.0050.00512.65
5.5.150.0060.00712.91
5.5.140.0050.00812.64
5.5.130.0040.00712.47
5.5.120.0130.00213.03
5.5.110.0060.00512.63
5.5.100.0060.00512.66
5.5.90.0040.00912.71
5.5.80.0000.01312.63
5.5.70.0050.00912.69
5.5.60.0030.00812.67
5.5.50.0060.00512.82
5.5.40.0050.00712.69
5.5.30.0080.00212.89
5.5.20.0060.00512.87
5.5.10.0020.00712.73
5.5.00.0000.01012.83
5.4.450.0120.01813.93
5.4.440.0140.02713.97
5.4.430.0110.02113.83
5.4.420.0140.02813.86
5.4.410.0170.02013.73
5.4.400.0110.01613.76
5.4.390.0130.02713.83
5.4.380.0130.02113.72
5.4.370.0120.02813.61
5.4.360.0140.02713.56
5.4.350.0130.02913.75
5.4.340.0130.02413.77
5.4.330.0020.00611.06
5.4.320.0140.02413.82
5.4.310.0080.02413.85
5.4.300.0100.02613.78
5.4.290.0080.01913.68
5.4.280.0100.02313.72
5.4.270.0090.02313.66
5.4.260.0130.01613.59
5.4.250.0170.02513.58
5.4.240.0120.02913.75
5.4.230.0100.02213.65
5.4.220.0110.02713.69
5.4.210.0170.01613.67
5.4.200.0160.02513.68
5.4.190.0150.02513.63
5.4.180.0120.01613.79
5.4.170.0100.03113.75
5.4.160.0150.02413.87
5.4.150.0080.02113.81
5.4.140.0110.01912.84
5.4.130.0130.01712.73
5.4.120.0110.02712.80
5.4.110.0150.01912.86
5.4.100.0150.02412.90
5.4.90.0140.02612.85
5.4.80.0160.01512.82
5.4.70.0150.02512.93
5.4.60.0120.02812.81
5.4.50.0150.01812.95
5.4.40.0110.02812.74
5.4.30.0110.02212.92
5.4.20.0120.01812.91
5.4.10.0070.02112.86
5.4.00.0140.02412.71
5.3.290.0120.02611.96
5.3.280.0140.01711.88
5.3.270.0070.03111.92
5.3.260.0110.01911.86
5.3.250.0110.02911.86
5.3.240.0110.01511.89
5.3.230.0110.02011.89
5.3.220.0140.02711.87
5.3.210.0110.02511.86
5.3.200.0120.01911.84
5.3.190.0130.01711.94
5.3.180.0160.02211.99
5.3.170.0150.01611.89
5.3.160.0120.01511.87
5.3.150.0130.01611.89
5.3.140.0130.02611.89
5.3.130.0120.02711.96
5.3.120.0110.02711.85
5.3.110.0100.01711.83
5.3.100.0110.02711.67
5.3.90.0120.01911.71
5.3.80.0120.02611.65
5.3.70.0150.01611.71
5.3.60.0090.02611.67
5.3.50.0160.01611.62
5.3.40.0110.01611.61
5.3.30.0070.01911.60
5.3.20.0090.01511.58
5.3.10.0140.01311.52
5.3.00.0110.02211.57
5.2.170.0100.03311.02
5.2.160.0130.03311.02
5.2.150.0140.02011.02
5.2.140.0130.01511.02
5.2.130.0140.03011.02
5.2.120.0140.02111.02
5.2.110.0120.01711.02
5.2.100.0120.02111.02
5.2.90.0100.01611.02
5.2.80.0150.02811.02
5.2.70.0150.01811.02
5.2.60.0100.01711.02
5.2.50.0140.01611.02
5.2.40.0180.02511.02
5.2.30.0150.02011.02
5.2.20.0100.01811.02
5.2.10.0080.02711.02
5.2.00.0100.02211.02
5.1.60.0070.01711.02
5.1.50.0100.02811.02
5.1.40.0150.02511.02
5.1.30.0100.02211.02
5.1.20.0090.03111.02
5.1.10.0130.01511.02
5.1.00.0110.01511.02
5.0.50.0080.01711.02
5.0.40.0080.02111.02
5.0.30.0070.02211.02
5.0.20.0070.01411.02
5.0.10.0100.01211.02
5.0.00.0110.01611.02
4.4.90.0070.01011.02
4.4.80.0030.01311.02
4.4.70.0070.02011.02
4.4.60.0080.01811.02
4.4.50.0050.01911.02
4.4.40.0070.02711.02
4.4.30.0050.02011.02
4.4.20.0060.01211.02
4.4.10.0050.01011.02
4.4.00.0080.01511.02
4.3.110.0060.01111.02
4.3.100.0030.01311.02
4.3.90.0090.01011.02
4.3.80.0080.02511.02
4.3.70.0050.02111.02
4.3.60.0040.02111.02
4.3.50.0070.01211.02
4.3.40.0080.01711.02
4.3.30.0020.01211.02
4.3.20.0050.01911.02
4.3.10.0030.01711.02
4.3.00.0030.01211.02

preferences:
41.94 ms | 401 KiB | 5 Q