3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Data implements \ArrayAccess, \Countable, \IteratorAggregate { /** * * Key-value pairs of data. * * @var array * */ protected $data = array(); /** * * Constructor. * * @param array $data The data for this object. * */ public function __construct(array $data = array()) { $this->data = $data; } /** * * ArrayAccess: does the requested key exist? * * @param int|string $key The requested key. * * @return bool * */ public function offsetExists($key) { return array_key_exists($key, $this->data); } /** * * ArrayAccess: get a key value. * * @param int|string $key The requested key. * * @return mixed * */ public function offsetGet($key) { return $this->data[$key]; } /** * * ArrayAccess: set a key value. * * @param int|string $key The requested key. * * @param mixed $val The value to set it to. * * @return void * */ public function offsetSet($key, $val) { $this->data[$key] = $val; } /** * * ArrayAccess: unset a key. * * @param int|string $key The requested key. * * @return void * */ public function offsetUnset($key) { unset($this->data[$key]); } /** * * Countable: how many keys are there? * * @return int * */ public function count() { return count($this->data); } /** * * IteratorAggregate: returns an external iterator for this struct. * * @return DataIterator * */ public function getIterator() { return new DataIterator($this, array_keys($this->data)); } public function __invoke() { } }

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.01218.55
8.3.50.0090.00917.52
8.3.40.0100.00718.68
8.3.30.0110.00418.72
8.3.20.0080.00018.65
8.3.10.0050.00320.58
8.3.00.0030.00619.26
8.2.180.0140.00016.50
8.2.170.0040.01122.96
8.2.160.0110.00418.81
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0140.00026.16
8.2.120.0070.00019.83
8.2.110.0100.00020.95
8.2.100.0070.00417.91
8.2.90.0050.00319.05
8.2.80.0050.00217.93
8.2.70.0000.00917.50
8.2.60.0070.00417.80
8.2.50.0040.00418.07
8.2.40.0040.00418.04
8.2.30.0040.00418.04
8.2.20.0040.00417.51
8.2.10.0090.00317.71
8.2.00.0030.00717.50
8.1.280.0170.00325.92
8.1.270.0050.00324.66
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0070.00322.38
8.1.230.0060.00620.95
8.1.220.0030.00617.74
8.1.210.0050.00318.83
8.1.200.0030.00717.23
8.1.190.0080.00017.28
8.1.180.0030.00618.10
8.1.170.0050.00318.90
8.1.160.0070.00018.82
8.1.150.0000.00718.65
8.1.140.0000.00717.31
8.1.130.0040.00417.71
8.1.120.0000.00717.44
8.1.110.0000.00717.47
8.1.100.0070.00017.38
8.1.90.0000.00717.43
8.1.80.0030.00417.33
8.1.70.0030.00317.43
8.1.60.0000.00817.46
8.1.50.0000.00717.34
8.1.40.0080.00017.41
8.1.30.0000.00817.67
8.1.20.0030.00617.48
8.1.10.0000.00717.45
8.1.00.0000.00817.25
8.0.300.0030.00519.85
8.0.290.0040.00416.75
8.0.280.0000.00818.31
8.0.270.0000.00717.24
8.0.260.0030.00316.80
8.0.250.0000.00716.96
8.0.240.0030.00816.97
8.0.230.0000.00716.77
8.0.220.0070.00016.89
8.0.210.0000.00716.88
8.0.200.0040.00416.85
8.0.190.0070.00016.95
8.0.180.0040.00416.82
8.0.170.0060.00316.77
8.0.160.0000.00716.83
8.0.150.0040.00416.77
8.0.140.0040.00716.78
8.0.130.0000.00813.16
8.0.120.0040.00416.80
8.0.110.0050.00316.71
8.0.100.0040.00416.93
8.0.90.0040.00416.88
8.0.80.0120.00816.83
8.0.70.0040.00416.93
8.0.60.0000.00816.91
8.0.50.0020.00516.75
8.0.30.0060.01617.18
8.0.20.0140.01116.96
8.0.10.0050.00216.87
8.0.00.0130.00516.61
7.4.330.0000.00512.96
7.4.320.0030.00316.51
7.4.300.0000.00616.59
7.4.290.0040.00416.61
7.4.280.0030.00716.56
7.4.270.0030.00316.54
7.4.260.0030.00313.21
7.4.250.0060.00316.54
7.4.240.0070.00016.43
7.4.230.0070.00016.66
7.4.220.0130.00316.52
7.4.210.0070.01016.49
7.4.200.0070.00016.38
7.4.190.0000.00716.38
7.4.160.0040.01116.56
7.4.150.0130.00616.31
7.4.140.0120.00516.49
7.4.130.0090.00816.38
7.4.120.0120.00716.54
7.4.110.0030.01316.52
7.4.100.0060.01216.42
7.4.90.0090.01116.48
7.4.80.0110.00516.36
7.4.70.0070.01016.58
7.4.60.0080.00816.31
7.4.50.0040.00416.36
7.4.40.0060.01016.42
7.4.30.0120.00416.38
7.4.00.0140.00014.98
7.3.330.0050.00213.20
7.3.320.0000.00513.18
7.3.310.0060.00316.05
7.3.300.0000.00716.22
7.3.290.0040.01116.25
7.3.280.0080.00816.19
7.3.270.0100.00716.48
7.3.260.0180.00516.36
7.3.250.0100.00716.24
7.3.240.0060.01216.41
7.3.230.0070.01016.14
7.3.210.0090.00916.39
7.3.200.0100.01019.39
7.3.190.0060.01216.22
7.3.180.0150.00316.55
7.3.170.0120.00916.14
7.3.160.0170.00016.44
7.3.120.0130.00314.59
7.3.10.0080.00316.57
7.3.00.0000.01316.38
7.2.330.0150.00216.38
7.2.320.0070.01016.60
7.2.310.0170.00316.40
7.2.300.0090.00816.47
7.2.290.0100.00716.26
7.2.130.0060.00616.48
7.2.120.0100.00216.49
7.2.110.0070.00316.64
7.2.100.0050.00716.60
7.2.90.0080.00816.43
7.2.80.0070.00616.64
7.2.70.0050.01016.90
7.2.60.0030.00816.60
7.2.50.0090.00516.71
7.2.40.0060.00716.85
7.2.30.0050.00816.69
7.2.20.0100.00516.73
7.2.10.0060.00616.53
7.2.00.0070.00917.58
7.1.250.0040.00715.72
7.1.240.0090.00215.68
7.1.230.0030.01015.62
7.1.220.0020.01215.64
7.1.210.0050.00815.47
7.1.200.0090.00315.59
7.1.190.0080.00315.61
7.1.180.0050.01115.54
7.1.170.0060.00715.54
7.1.160.0050.00715.67
7.1.150.0030.00915.55
7.1.140.0050.00915.51
7.1.130.0030.01015.74
7.1.120.0090.00815.55
7.1.110.0100.00315.55
7.1.100.0050.00816.48
7.1.90.0100.00315.58
7.1.80.0110.00515.76
7.1.70.0040.00715.84
7.1.60.0080.00616.97
7.1.50.0110.01021.96
7.1.40.0050.00815.45
7.1.30.0060.00615.60
7.1.20.0050.00915.59
7.1.10.0020.00815.62
7.1.00.0080.02517.84
7.0.330.0030.01015.04
7.0.320.0100.00415.28
7.0.310.0100.00315.17
7.0.300.0040.00715.10
7.0.290.0040.00515.10
7.0.280.0020.01015.21
7.0.270.0070.00515.34
7.0.260.0050.00515.26
7.0.250.0020.00815.25
7.0.240.0060.00915.30
7.0.230.0050.00915.13
7.0.220.0050.00615.28
7.0.210.0030.01015.35
7.0.200.0090.00215.69
7.0.190.0060.00915.21
7.0.180.0070.00515.27
7.0.170.0070.00215.11
7.0.160.0020.01015.14
7.0.150.0060.00615.19
7.0.140.0060.02717.55
7.0.130.0000.00915.32
7.0.120.0050.02917.63
7.0.110.0050.00715.04
7.0.100.0070.00515.27
7.0.90.0050.00715.34
7.0.80.0050.00715.35
7.0.70.0090.00515.36
7.0.60.0060.02916.86
7.0.50.0070.03116.32
7.0.40.0110.03015.50
7.0.30.0090.02515.66
7.0.20.0110.01515.68
7.0.10.0040.02015.60
7.0.00.0030.03215.59
5.6.380.0030.00814.30
5.6.370.0040.00914.27
5.6.360.0030.01013.76
5.6.350.0040.00914.28
5.6.340.0010.01214.10
5.6.330.0020.00813.83
5.6.320.0060.00614.09
5.6.310.0040.00814.12
5.6.300.0040.00713.98
5.6.290.0050.00914.27
5.6.280.0060.02716.31
5.6.270.0050.00714.10
5.6.260.0080.00314.12
5.6.250.0050.00714.24
5.6.240.0050.00714.03
5.6.230.0030.00914.31
5.6.220.0030.00913.98
5.6.210.0030.03016.19
5.6.200.0060.02215.36
5.6.190.0050.01816.25
5.6.180.0160.02616.48
5.6.170.0110.03116.22
5.6.160.0040.01916.27
5.6.150.0020.02415.60
5.6.140.0010.02115.40
5.6.130.0060.03015.37
5.6.120.0030.02016.38
5.6.110.0040.02016.25
5.6.100.0060.03216.34
5.6.90.0070.02916.38
5.6.80.0090.01516.33
5.6.70.0080.00414.02
5.6.60.0050.01014.10
5.6.50.0080.00314.00
5.6.40.0110.00313.89
5.6.30.0040.00914.01
5.6.20.0080.00513.98
5.6.10.0080.00813.95
5.6.00.0050.01013.81
5.5.380.0020.00910.84
5.5.370.0060.00310.90
5.5.360.0010.00610.89
5.5.350.0130.02614.00
5.5.340.0030.01913.15
5.5.330.0070.02414.10
5.5.320.0100.01714.11
5.5.310.0130.02814.19
5.5.300.0030.02213.20
5.5.290.0020.02013.30
5.5.280.0070.01814.25
5.5.270.0060.03214.19
5.5.260.0030.02814.34
5.5.250.0040.02314.07
5.5.240.0020.03213.89
5.5.230.0040.00410.76
5.5.220.0030.00610.79
5.5.210.0050.00510.60
5.5.200.0050.00310.87
5.5.190.0030.00710.68
5.5.180.0040.00610.90
5.5.170.0060.00412.41
5.5.160.0050.00510.65
5.5.150.0030.00710.79
5.5.140.0040.00610.76
5.5.130.0070.00411.06
5.5.120.0050.00610.90
5.5.110.0020.00911.04
5.5.100.0050.00510.97
5.5.90.0070.00110.92
5.5.80.0030.00611.02
5.5.70.0050.00510.60
5.5.60.0050.00310.80
5.5.50.0070.00410.81
5.5.40.0030.00710.73
5.5.30.0020.00810.72
5.5.20.0040.00710.75
5.5.10.0050.00510.84
5.5.00.0040.00610.74
5.4.450.0080.02213.78
5.4.440.0020.02113.78
5.4.430.0080.01913.65
5.4.420.0030.02513.81
5.4.410.0030.03213.70
5.4.400.0060.02813.54
5.4.390.0060.02113.59
5.4.380.0030.02213.55
5.4.370.0040.01813.54
5.4.360.0010.02613.36
5.4.350.0050.02813.66
5.4.340.0060.02513.63
5.4.330.0020.00510.88
5.4.320.0020.01913.66
5.4.310.0030.02013.60
5.4.300.0090.02613.46
5.4.290.0070.01413.53
5.4.280.0050.03013.52
5.4.270.0060.02613.48
5.4.260.0070.02113.53
5.4.250.0000.02213.70
5.4.240.0010.02013.42
5.4.230.0080.01413.64
5.4.220.0040.02113.42
5.4.210.0020.03213.40
5.4.200.0020.02313.51
5.4.190.0070.02613.52
5.4.180.0060.02813.55
5.4.170.0070.01813.43
5.4.160.0050.02813.53
5.4.150.0010.02813.48
5.4.140.0020.02012.55
5.4.130.0040.02312.62
5.4.120.0010.01912.50
5.4.110.0090.01912.64
5.4.100.0030.02112.69
5.4.90.0050.02712.68
5.4.80.0100.02112.50
5.4.70.0050.01612.73
5.4.60.0110.02112.78
5.4.50.0050.01612.79
5.4.40.0040.02112.70
5.4.30.0050.02612.58
5.4.20.0060.02112.58
5.4.10.0040.01912.72
5.4.00.0030.01512.54
5.3.290.0060.01611.91
5.3.280.0080.02711.71
5.3.270.0030.02611.79
5.3.260.0020.01811.70
5.3.250.0050.02511.70
5.3.240.0030.01611.72
5.3.230.0040.01611.77
5.3.220.0030.01411.64
5.3.210.0020.03111.63
5.3.200.0060.02211.68
5.3.190.0040.01911.71
5.3.180.0060.01611.84
5.3.170.0040.01711.89
5.3.160.0030.01711.83
5.3.150.0060.01511.73
5.3.140.0020.01911.72
5.3.130.0030.02511.77
5.3.120.0030.01611.73
5.3.110.0070.02511.72
5.3.100.0040.01611.52
5.3.90.0030.01711.66
5.3.80.0070.02211.55
5.3.70.0050.02911.54
5.3.60.0050.02911.60
5.3.50.0050.02811.49
5.3.40.0060.01611.40
5.3.30.0050.02711.50
5.3.20.0060.02011.41
5.3.10.0040.01711.31
5.3.00.0040.02411.33
5.2.170.0020.01510.28
5.2.160.0010.01410.28
5.2.150.0010.02310.31
5.2.140.0060.02010.25
5.2.130.0040.01610.23
5.2.120.0060.02210.11
5.2.110.0010.02310.29
5.2.100.0020.02010.26
5.2.90.0040.01910.18
5.2.80.0060.01610.20
5.2.70.0030.01410.27
5.2.60.0050.02010.17
5.2.50.0070.01110.21
5.2.40.0050.01010.11
5.2.30.0020.01310.20
5.2.20.0020.01310.14
5.2.10.0020.01510.04
5.2.00.0040.0149.92
5.1.60.0050.0149.61
5.1.50.0030.0209.56
5.1.40.0030.0199.60
5.1.30.0000.0239.68
5.1.20.0030.0179.72
5.1.10.0010.0169.65
5.1.00.0040.0219.62
5.0.50.0010.0209.12
5.0.40.0020.0189.08
5.0.30.0030.0148.99
5.0.20.0060.0148.98
5.0.10.0030.0138.97
5.0.00.0030.0269.00
4.4.90.0010.0078.84
4.4.80.0020.0098.84
4.4.70.0000.0088.84
4.4.60.0020.0078.84
4.4.50.0030.0068.84
4.4.40.0010.0228.84
4.4.30.0010.0108.84
4.4.20.0030.0138.84
4.4.10.0020.0148.84
4.4.00.0030.0148.84
4.3.110.0040.0128.84
4.3.100.0040.0078.84
4.3.90.0020.0138.84
4.3.80.0020.0118.84
4.3.70.0020.0118.84
4.3.60.0020.0158.84
4.3.50.0010.0178.84
4.3.40.0030.0208.84
4.3.30.0040.0108.84
4.3.20.0030.0118.84
4.3.10.0000.0178.84
4.3.00.0030.0128.84

preferences:
69.48 ms | 401 KiB | 5 Q