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() { return $this->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); }); var_dump($c); }); var_dump($c); });

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.50
8.3.50.0120.00522.00
8.3.40.0120.00318.83
8.3.30.0120.00319.04
8.3.20.0070.00020.34
8.3.10.0080.00023.48
8.3.00.0040.00419.38
8.2.180.0180.00416.36
8.2.170.0120.00322.96
8.2.160.0070.00720.44
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0030.01026.16
8.2.120.0080.00022.13
8.2.110.0000.01020.93
8.2.100.0080.00418.34
8.2.90.0050.00319.09
8.2.80.0030.00517.97
8.2.70.0060.00317.63
8.2.60.0050.00317.93
8.2.50.0070.00018.10
8.2.40.0000.00820.59
8.2.30.0040.00419.25
8.2.20.0000.00717.66
8.2.10.0070.00018.18
8.2.00.0030.00517.81
8.1.280.0110.00425.92
8.1.270.0000.00821.91
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0160.00319.12
8.1.230.0070.00420.32
8.1.220.0090.00017.74
8.1.210.0050.00318.77
8.1.200.0030.00717.38
8.1.190.0030.00617.23
8.1.180.0040.00418.10
8.1.170.0030.00518.59
8.1.160.0000.00718.83
8.1.150.0040.00420.16
8.1.140.0000.00817.44
8.1.130.0070.00017.75
8.1.120.0000.00717.44
8.1.110.0040.00417.29
8.1.100.0050.00217.46
8.1.90.0040.00417.52
8.1.80.0000.00717.41
8.1.70.0000.00817.45
8.1.60.0050.00317.49
8.1.50.0040.00417.55
8.1.40.0080.00017.57
8.1.30.0000.00817.63
8.1.20.0030.00517.68
8.1.10.0040.00417.51
8.1.00.0000.00717.46
8.0.300.0000.00818.77
8.0.290.0000.00716.75
8.0.280.0030.00318.30
8.0.270.0040.00417.11
8.0.260.0000.00716.74
8.0.250.0030.00316.91
8.0.240.0050.00316.86
8.0.230.0040.00416.87
8.0.220.0070.00016.82
8.0.210.0030.00316.86
8.0.200.0030.00317.02
8.0.190.0080.00017.00
8.0.180.0000.00816.96
8.0.170.0060.00316.86
8.0.160.0000.00716.98
8.0.150.0040.00416.91
8.0.140.0000.00816.81
8.0.130.0060.00013.37
8.0.120.0040.00416.85
8.0.110.0040.00417.00
8.0.100.0030.00516.85
8.0.90.0030.00516.89
8.0.80.0120.00316.90
8.0.70.0040.00416.90
8.0.60.0000.00717.02
8.0.50.0040.00416.75
8.0.30.0140.00717.11
8.0.20.0170.00317.40
8.0.10.0000.00817.10
8.0.00.0060.01516.56
7.4.330.0000.00515.15
7.4.320.0000.00616.55
7.4.300.0000.00616.55
7.4.290.0040.00416.51
7.4.280.0040.00416.49
7.4.270.0030.00316.63
7.4.260.0000.00716.58
7.4.250.0060.00316.61
7.4.240.0000.00716.58
7.4.230.0030.00316.64
7.4.220.0120.00616.55
7.4.210.0100.00516.45
7.4.200.0030.00416.66
7.4.190.0030.00316.52
7.4.160.0040.01616.61
7.4.150.0180.00917.40
7.4.140.0110.00817.86
7.4.130.0090.00916.49
7.4.120.0110.00716.43
7.4.110.0130.01016.56
7.4.100.0080.01116.40
7.4.90.0100.01016.40
7.4.80.0060.01219.39
7.4.70.0130.00516.38
7.4.60.0070.01116.28
7.4.50.0000.00816.58
7.4.40.0060.00922.77
7.4.30.0110.00616.59
7.4.00.0060.01115.15
7.3.330.0030.00313.21
7.3.320.0040.00413.32
7.3.310.0000.00716.28
7.3.300.0030.00316.15
7.3.290.0030.01716.36
7.3.280.0090.01216.38
7.3.270.0110.00817.40
7.3.260.0110.00616.36
7.3.250.0160.00516.51
7.3.240.0150.00316.46
7.3.230.0130.00316.43
7.3.210.0110.00716.57
7.3.200.0090.01219.39
7.3.190.0120.00616.45
7.3.180.0120.00516.31
7.3.170.0100.00616.40
7.3.160.0090.00916.64
7.3.120.0000.01615.08
7.3.10.0150.00416.49
7.3.00.0140.00616.59
7.2.330.0080.01116.65
7.2.320.0030.01516.74
7.2.310.0160.00816.41
7.2.300.0040.01616.49
7.2.290.0040.01816.37
7.2.130.0030.01016.64
7.2.120.0130.00316.89
7.2.110.0090.00716.67
7.2.100.0070.00716.71
7.2.90.0140.00316.63
7.2.80.0080.00916.56
7.2.70.0110.00816.82
7.2.60.0160.00516.87
7.2.50.0090.01016.90
7.2.40.0110.00716.65
7.2.30.0110.00516.64
7.2.20.0120.00716.76
7.2.10.0150.00616.56
7.2.00.0120.00517.42
7.1.250.0210.00615.84
7.1.230.0030.00715.65
7.1.220.0040.00815.59
7.1.210.0090.00315.65
7.1.200.0130.00015.83
7.1.190.0030.00615.82
7.1.180.0080.00815.97
7.1.170.0040.00815.89
7.1.160.0070.00715.68
7.1.150.0070.00715.91
7.1.140.0000.01315.95
7.1.130.0060.00615.71
7.1.120.0080.00415.90
7.1.110.0080.00315.64
7.1.100.0080.00416.97
7.1.90.0030.00915.89
7.1.80.0000.01415.77
7.1.70.0020.01016.47
7.1.60.0060.00817.66
7.1.50.0060.00716.28
7.1.40.0060.00615.93
7.1.30.0090.00615.73
7.1.20.0060.01015.88
7.1.10.0070.00015.53
7.1.00.0040.04119.06
7.0.310.0070.00715.43
7.0.300.0030.00615.41
7.0.290.0040.00815.35
7.0.280.0060.00615.34
7.0.270.0060.00615.26
7.0.260.0100.00315.45
7.0.250.0030.01315.35
7.0.240.0070.00415.49
7.0.230.0000.01115.59
7.0.220.0040.00715.30
7.0.210.0050.00315.45
7.0.200.0100.00415.96
7.0.190.0060.00315.52
7.0.180.0060.00615.43
7.0.170.0080.00015.50
7.0.160.0070.00415.30
7.0.150.0030.01015.13
7.0.140.0050.03818.69
7.0.130.0030.00915.54
7.0.120.0100.00015.53
7.0.110.0100.00315.28
7.0.100.0070.04017.53
7.0.90.0020.02717.59
7.0.80.0080.02117.71
7.0.70.0000.02717.60
7.0.60.0030.02317.68
7.0.50.0000.03217.92
7.0.40.0030.02516.58
7.0.30.0050.03716.88
7.0.20.0030.02616.76
7.0.10.0020.02616.83
7.0.00.0070.02316.65
5.6.380.0030.01014.26
5.6.370.0130.00014.50
5.6.360.0060.00614.27
5.6.350.0100.00314.69
5.6.340.0030.01014.44
5.6.330.0040.00413.97
5.6.320.0080.00414.26
5.6.310.0030.00714.25
5.6.300.0000.01114.40
5.6.290.0090.00314.57
5.6.280.0080.03517.77
5.6.270.0030.01014.32
5.6.260.0030.01014.61
5.6.250.0070.03517.36
5.6.240.0050.03017.58
5.6.230.0060.02317.48
5.6.220.0040.02117.39
5.6.210.0050.02217.38
5.6.200.0110.02517.71
5.6.190.0100.03317.62
5.6.180.0050.02817.55
5.6.170.0090.02817.81
5.6.160.0060.02517.53
5.6.150.0040.02217.82
5.6.140.0030.02517.67
5.6.130.0090.02317.87
5.6.120.0050.03317.55
5.6.110.0030.02517.69
5.6.100.0020.03217.72
5.6.90.0030.04817.73
5.6.80.0070.02217.23
5.6.70.0030.02217.31
5.6.60.0100.02217.37
5.6.50.0000.04217.19
5.6.40.0050.04117.31
5.6.30.0020.02417.30
5.6.20.0060.02817.45
5.6.10.0100.03717.24
5.6.00.0120.03917.33
5.5.380.0000.02816.17
5.5.370.0030.02116.09
5.5.360.0010.02516.05
5.5.350.0060.02316.05
5.5.340.0090.01916.27
5.5.330.0050.02316.27
5.5.320.0070.03216.34
5.5.310.0050.02216.32
5.5.300.0010.02416.29
5.5.290.0020.03316.26
5.5.280.0050.02516.32
5.5.270.0090.01816.34
5.5.260.0080.02016.34
5.5.250.0060.02316.16
5.5.240.0060.02216.03
5.5.230.0070.01816.00
5.5.220.0060.02015.94
5.5.210.0050.02115.98
5.5.200.0050.04316.02
5.5.190.0030.02216.00
5.5.180.0040.02216.01
5.5.170.0000.01214.44
5.5.160.0030.04716.00
5.5.150.0050.04315.98
5.5.140.0070.01915.97
5.5.130.0050.04015.95
5.5.120.0100.03215.98
5.5.110.0030.02615.96
5.5.100.0040.04415.96
5.5.90.0050.03815.95
5.5.80.0100.03515.96
5.5.70.0090.03515.84
5.5.60.0090.03315.99
5.5.50.0130.03515.92
5.5.40.0080.03815.89
5.5.30.0050.04415.97
5.5.20.0070.04215.95
5.5.10.0050.04315.95
5.5.00.0070.04215.91
5.4.450.0080.04015.57
5.4.440.0050.02015.56
5.4.430.0050.02015.52
5.4.420.0070.01915.56
5.4.410.0010.02415.60
5.4.400.0050.03015.44
5.4.390.0030.02815.40
5.4.380.0030.02315.44
5.4.370.0050.02115.50
5.4.360.0040.02715.47
5.4.350.0050.02015.41
5.4.340.0050.03515.36
5.4.330.0000.01111.76
5.4.320.0080.03915.31
5.4.310.0050.04215.46
5.4.300.0050.04515.44
5.4.290.0090.03715.32
5.4.280.0060.02315.43
5.4.270.0120.03315.39
5.4.260.0040.03715.45
5.4.250.0060.02515.40
5.4.240.0050.04015.49
5.4.230.0130.03315.42
5.4.220.0020.03815.44
5.4.210.0110.03715.32
5.4.200.0090.03515.48
5.4.190.0070.03015.44
5.4.180.0070.04015.49
5.4.170.0020.04515.32
5.4.160.0080.02215.39
5.4.150.0050.04215.43
5.4.140.0030.04214.07
5.4.130.0080.03714.11
5.4.120.0070.03514.05
5.4.110.0050.03814.07
5.4.100.0030.03814.08
5.4.90.0110.03514.11
5.4.80.0080.03814.15
5.4.70.0070.04014.15
5.4.60.0050.03814.04
5.4.50.0000.04014.11
5.4.40.0030.04014.12
5.4.30.0050.04114.09
5.4.20.0050.03814.04
5.4.10.0030.04114.01
5.4.00.0020.02713.81
5.3.290.0060.04013.21
5.3.280.0030.02713.23
5.3.270.0070.03813.21
5.3.260.0100.03713.24
5.3.250.0060.03813.20
5.3.240.0080.04013.22
5.3.230.0090.03513.14
5.3.220.0100.03313.15
5.3.210.0050.04013.17
5.3.200.0070.03913.13
5.3.190.0080.03713.19
5.3.180.0020.02713.21
5.3.170.0070.03313.21
5.3.160.0070.03213.19
5.3.150.0120.03513.19
5.3.140.0100.03513.14
5.3.130.0050.03213.14
5.3.120.0050.04213.16
5.3.110.0080.03513.20
5.3.100.0040.04412.97
5.3.90.0050.04212.97
5.3.80.0030.04012.97
5.3.70.0050.02212.97
5.3.60.0030.03612.97
5.3.50.0080.03612.97
5.3.40.0030.04112.97
5.3.30.0030.03512.97
5.3.20.0050.04012.97
5.3.10.0100.03312.97
5.3.00.0030.03512.97
5.2.170.0040.03012.97
5.2.160.0050.03112.97
5.2.150.0060.03312.97
5.2.140.0050.03312.97
5.2.130.0070.02912.97
5.2.120.0050.03212.97
5.2.110.0010.03512.97
5.2.100.0080.03012.97
5.2.90.0040.03112.97
5.2.80.0040.02012.97
5.2.70.0050.03012.97
5.2.60.0070.03112.97
5.2.50.0010.03412.97
5.2.40.0070.02912.97
5.2.30.0070.02812.97
5.2.20.0030.03312.97
5.2.10.0020.03412.97
5.2.00.0050.03212.97
5.1.60.0030.02512.97
5.1.50.0040.01712.97
5.1.40.0030.03012.97
5.1.30.0030.03212.97
5.1.20.0020.02212.97
5.1.10.0030.02812.97
5.1.00.0070.02512.97
5.0.50.0040.02512.97
5.0.40.0040.02512.97
5.0.30.0020.03112.97
5.0.20.0050.02212.97
5.0.10.0060.02112.97
5.0.00.0050.03212.97
4.4.90.0030.01812.97
4.4.80.0020.01812.97
4.4.70.0010.02112.97
4.4.60.0030.02012.97
4.4.50.0070.01212.97
4.4.40.0040.02212.97
4.4.30.0030.01812.97
4.4.20.0050.01512.97
4.4.10.0020.01912.97
4.4.00.0000.02512.97
4.3.110.0010.02012.97
4.3.100.0000.02112.97
4.3.90.0020.01812.97
4.3.80.0030.02812.97
4.3.70.0020.01612.97
4.3.60.0030.01812.97
4.3.50.0030.01712.97
4.3.40.0020.02812.97
4.3.30.0010.02012.97
4.3.20.0030.02012.97
4.3.10.0020.02012.97
4.3.00.0020.01812.97

preferences:
47.59 ms | 401 KiB | 5 Q