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 = []; /** * * Constructor. * * @param array $data The data for this object. * */ public function __construct(array $data = []) { $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)); } }

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.0110.00718.43
8.3.50.0090.00721.21
8.3.40.0060.00918.59
8.3.30.0120.00318.75
8.3.20.0000.00818.60
8.3.10.0080.00020.42
8.3.00.0000.00821.90
8.2.180.0100.00716.88
8.2.170.0000.01522.96
8.2.160.0140.00320.35
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0060.00326.16
8.2.120.0000.00819.52
8.2.110.0030.00622.16
8.2.100.0110.00017.78
8.2.90.0040.00417.86
8.2.80.0040.00417.97
8.2.70.0050.00317.50
8.2.60.0000.00717.90
8.2.50.0060.00318.07
8.2.40.0000.00718.05
8.2.30.0030.00619.75
8.2.20.0000.00717.58
8.2.10.0070.00017.58
8.2.00.0000.00917.75
8.1.280.0120.00925.92
8.1.270.0070.00023.99
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0060.00320.66
8.1.230.0100.00021.04
8.1.220.0090.00017.74
8.1.210.0040.00418.77
8.1.200.0030.00617.38
8.1.190.0040.00417.53
8.1.180.0000.00818.10
8.1.170.0030.00618.77
8.1.160.0040.00418.89
8.1.150.0030.00518.61
8.1.140.0080.00017.30
8.1.130.0000.00717.84
8.1.120.0050.00317.45
8.1.110.0030.00517.42
8.1.100.0000.00717.43
8.1.90.0050.00217.36
8.1.80.0030.00517.44
8.1.70.0030.00317.41
8.1.60.0080.00017.52
8.1.50.0000.00717.47
8.1.40.0000.00817.53
8.1.30.0030.00517.48
8.1.20.0050.00317.54
8.1.10.0030.00617.42
8.1.00.0040.00417.36
8.0.300.0040.00419.87
8.0.290.0040.00416.63
8.0.280.0070.00018.41
8.0.270.0070.00017.31
8.0.260.0000.00716.84
8.0.250.0080.00016.87
8.0.240.0000.01016.86
8.0.230.0030.00316.80
8.0.220.0000.00716.85
8.0.210.0070.00016.73
8.0.200.0030.00316.93
8.0.190.0000.00816.93
8.0.180.0040.00416.92
8.0.170.0030.00616.79
8.0.160.0060.00616.79
8.0.150.0030.00516.78
8.0.140.0030.00516.74
8.0.130.0060.00013.33
8.0.120.0040.00416.83
8.0.110.0080.00016.83
8.0.100.0000.00816.74
8.0.90.0050.00316.70
8.0.80.0070.01016.82
8.0.70.0000.00716.66
8.0.60.0040.00416.87
8.0.50.0050.00316.75
8.0.30.0090.01517.23
8.0.20.0090.00917.40
8.0.10.0040.00416.88
8.0.00.0090.01016.70
7.4.330.0020.00214.84
7.4.320.0000.00616.56
7.4.300.0060.00016.48
7.4.290.0040.00416.48
7.4.280.0050.00316.39
7.4.270.0030.00316.57
7.4.260.0030.00313.17
7.4.250.0050.00316.54
7.4.240.0070.00016.58
7.4.230.0050.00216.38
7.4.220.0060.01216.53
7.4.210.0080.01116.56
7.4.200.0050.00216.59
7.4.190.0070.00016.44
7.4.160.0130.00416.34
7.4.150.0070.01017.40
7.4.140.0100.01017.86
7.4.130.0090.00916.49
7.4.120.0090.00916.42
7.4.110.0070.01016.48
7.4.100.0120.00916.51
7.4.90.0120.01216.34
7.4.80.0070.01119.04
7.4.70.0230.00316.36
7.4.60.0170.00016.24
7.4.50.0030.00316.38
7.4.40.0090.00622.27
7.4.30.0100.00716.40
7.4.00.0000.01414.94
7.3.330.0050.00013.06
7.3.320.0000.00513.00
7.3.310.0000.00716.19
7.3.300.0080.00016.21
7.3.290.0070.00716.18
7.3.280.0100.00616.18
7.3.270.0090.00917.40
7.3.260.0080.01418.24
7.3.250.0020.01516.33
7.3.240.0150.00416.30
7.3.230.0140.00316.48
7.3.210.0060.01016.31
7.3.200.0100.01019.39
7.3.190.0090.01216.57
7.3.180.0180.00316.57
7.3.170.0130.00316.27
7.3.160.0030.01416.24
7.3.120.0130.00014.88
7.3.10.0040.01016.22
7.3.00.0030.01216.50
7.2.330.0140.00316.55
7.2.320.0100.01316.49
7.2.310.0130.00716.50
7.2.300.0070.01016.44
7.2.290.0030.01316.54
7.2.130.0080.00616.76
7.2.120.0080.00516.49
7.2.110.0060.00916.70
7.2.100.0040.01216.83
7.2.90.0070.00816.70
7.2.80.0070.00516.64
7.2.70.0030.01116.73
7.2.60.0110.00116.63
7.2.50.0050.01016.64
7.2.40.0070.00516.71
7.2.30.0080.00616.72
7.2.20.0050.01016.63
7.2.10.0030.00616.66
7.2.00.0050.00816.63
7.1.250.0050.00715.52
7.1.240.0070.00415.70
7.1.230.0100.00315.63
7.1.220.0130.00015.58
7.1.210.0040.00715.55
7.1.200.0030.00915.46
7.1.190.0030.00615.44
7.1.180.0070.00415.82
7.1.170.0090.00615.83
7.1.160.0060.00615.49
7.1.150.0090.00315.51
7.1.140.0060.00915.59
7.1.130.0090.00615.61
7.1.120.0070.01015.71
7.1.110.0000.01315.54
7.1.100.0030.01315.86
7.1.90.0000.00915.90
7.1.80.0070.00715.49
7.1.70.0020.00916.17
7.1.60.0070.01117.37
7.1.50.0070.00716.24
7.1.40.0030.01315.75
7.1.30.0070.00615.42
7.1.20.0070.00715.73
7.1.10.0070.00715.70
7.1.00.0030.03718.96
7.0.330.0090.00615.52
7.0.320.0060.00614.97
7.0.310.0030.01015.32
7.0.300.0070.00715.28
7.0.290.0000.01015.24
7.0.280.0030.01015.02
7.0.270.0120.00315.16
7.0.260.0000.01215.22
7.0.250.0000.01215.26
7.0.240.0030.01315.45
7.0.230.0070.01015.32
7.0.220.0030.00915.32
7.0.210.0040.00815.36
7.0.200.0080.00315.81
7.0.190.0090.00315.12
7.0.180.0140.00315.38
7.0.170.0090.00315.13
7.0.160.0070.00715.24
7.0.150.0030.00615.25
7.0.140.0100.03418.56
7.0.130.0110.00415.29
7.0.120.0090.00915.46
7.0.110.0070.00715.31
7.0.100.0000.01115.40
7.0.90.0110.00315.14
7.0.80.0120.00315.30
7.0.70.0080.00015.45
7.0.60.0070.02817.63
7.0.50.0050.04516.72
7.0.40.0080.02216.83
7.0.30.0120.05116.82
7.0.20.0140.02016.75
7.0.10.0090.02416.77
7.0.00.0070.04216.72
5.6.380.0040.01114.36
5.6.370.0000.01314.19
5.6.360.0000.00914.23
5.6.350.0070.00714.07
5.6.340.0070.00414.21
5.6.330.0070.00714.15
5.6.320.0040.00714.14
5.6.310.0100.00614.25
5.6.300.0030.01014.16
5.6.290.0030.01014.38
5.6.280.0050.03817.59
5.6.270.0030.00614.24
5.6.260.0030.01013.93
5.6.250.0000.01514.00
5.6.240.0000.00914.13
5.6.230.0050.00314.31
5.6.220.0060.00614.05
5.6.210.0060.03017.43
5.6.200.0080.04316.27
5.6.190.0050.02517.27
5.6.180.0220.03517.40
5.6.170.0180.02717.23
5.6.160.0060.03417.24
5.6.150.0080.04216.05
5.6.140.0080.04416.18
5.6.130.0050.02716.15
5.6.120.0120.04317.58
5.6.110.0080.03217.44
5.6.100.0100.03717.56
5.6.90.0070.04517.75
5.6.80.0140.03117.27
5.6.70.2310.02017.27
5.6.60.0030.01014.29
5.6.50.0040.01413.89
5.6.40.0120.00313.92
5.6.30.0060.00314.18
5.6.20.0000.00913.96
5.6.10.0000.01214.03
5.6.00.0040.01114.16
5.5.380.0000.01111.04
5.5.370.0060.00611.06
5.5.360.0000.01011.04
5.5.350.0160.03715.70
5.5.340.0050.02314.34
5.5.330.0000.02615.46
5.5.320.0180.02315.56
5.5.310.0120.03815.78
5.5.300.0040.04014.55
5.5.290.0050.03214.43
5.5.280.0020.02715.93
5.5.270.0050.04315.99
5.5.260.0030.02115.93
5.5.250.0090.03715.65
5.5.240.1930.02315.58
5.5.230.0070.00410.88
5.5.220.0030.00710.91
5.5.210.0030.00310.64
5.5.200.0050.00511.08
5.5.190.0030.01010.86
5.5.180.0000.00710.72
5.5.170.0000.00610.91
5.5.160.0050.00510.71
5.5.150.0030.00610.72
5.5.140.0030.00311.02
5.5.130.0030.00910.98
5.5.120.0070.00310.76
5.5.110.0000.00810.91
5.5.100.0060.00010.88
5.5.90.0000.01110.82
5.5.80.0000.00810.64
5.5.70.0040.00810.82
5.5.60.0060.00610.70
5.5.50.0060.00610.67
5.5.40.0000.01110.37
5.5.30.0030.00910.88
5.5.20.0000.01010.81
5.5.10.0030.01111.11
5.5.00.0100.00310.75
5.4.450.1460.02015.29
5.4.440.1420.02415.21
5.4.430.1820.02815.16
5.4.420.1830.02215.05
5.4.410.1720.02515.15
5.4.400.1580.02515.07
5.4.390.1480.02114.98
5.4.380.1580.02314.78
5.4.370.1520.01914.96
5.4.360.1470.02414.95
5.4.350.1670.02314.88
5.4.340.1500.02414.93
5.4.330.0000.00610.89
5.4.320.1500.02015.12
5.4.310.1670.02215.01
5.4.300.1750.02314.92
5.4.290.1650.02314.88
5.4.280.1710.02814.85
5.4.270.1530.02314.95
5.4.260.1520.01714.89
5.4.250.1590.02215.09
5.4.240.1810.02115.04
5.4.230.1630.02014.96
5.4.220.0960.02115.00
5.4.210.1030.02315.03
5.4.200.1450.01814.86
5.4.190.1410.02015.07
5.4.180.1380.01814.75
5.4.170.1200.02014.99
5.4.160.1510.02314.83
5.4.150.1450.02314.98
5.4.140.1620.02213.69
5.4.130.1620.02213.74
5.4.120.1650.02213.78
5.4.110.1480.02113.85
5.4.100.1450.01813.64
5.4.90.1520.02213.56
5.4.80.1900.01813.66
5.4.70.1960.01513.73
5.4.60.1650.02113.70
5.4.50.1720.01913.74
5.4.40.1630.02013.68
5.4.30.1710.02113.60
5.4.20.1980.02513.47
5.4.10.2050.02313.46
5.4.00.1920.02213.43
5.3.290.1740.02412.58
5.3.280.1630.01812.46
5.3.270.1550.02012.47
5.3.260.1720.02512.43
5.3.250.1630.02312.44
5.3.240.1600.02512.40
5.3.230.1600.02212.37
5.3.220.1420.02512.43
5.3.210.1420.02312.38
5.3.200.1450.01912.32
5.3.190.1500.02312.39
5.3.180.1830.02612.48
5.3.170.1700.02112.34
5.3.160.1650.02012.51
5.3.150.1640.01812.41
5.3.140.1770.01612.51
5.3.130.2000.02312.39
5.3.120.2030.02212.52
5.3.110.1930.02112.34
5.3.100.1980.02412.19
5.3.90.2070.01712.18
5.3.80.1970.02512.18
5.3.70.2220.01812.13
5.3.60.2090.01512.13
5.3.50.1830.02012.13
5.3.40.0090.03712.17
5.3.30.0090.03312.22
5.3.20.2020.02311.94
5.3.10.1880.02011.97
5.3.00.1740.02311.89
5.2.170.1750.01310.61
5.2.160.1130.01810.70
5.2.150.0020.03510.70
5.2.140.0820.01810.66
5.2.130.1580.01710.60
5.2.120.2080.01610.74
5.2.110.1670.02010.63
5.2.100.1650.01510.59
5.2.90.1570.01810.60
5.2.80.1470.01910.66
5.2.70.1590.01310.58
5.2.60.1680.01810.56
5.2.50.1430.01810.68
5.2.40.1150.02010.57
5.2.30.1070.01710.53
5.2.20.1330.02010.68
5.2.10.1140.01710.50
5.2.00.1070.01710.55
5.1.60.0980.01510.09
5.1.50.0970.01410.09
5.1.40.0990.01110.09
5.1.30.1050.01210.24
5.1.20.0760.01410.24
5.1.10.0040.01510.09
5.1.00.0030.01910.09
5.0.50.0000.01610.09
5.0.40.0000.01410.09
5.0.30.0290.01710.09
5.0.20.0530.01210.09
5.0.10.0520.01410.09
5.0.00.0590.01610.09
4.4.90.0600.00810.09
4.4.80.0700.01210.09
4.4.70.0650.01010.09
4.4.60.0600.00710.09
4.4.50.0680.01210.09
4.4.40.0470.01510.09
4.4.30.0480.01010.09
4.4.20.0030.00810.09
4.4.10.0020.01010.09
4.4.00.0030.01810.09
4.3.110.0050.00710.09
4.3.100.0580.01010.09
4.3.90.0550.01010.09
4.3.80.0700.01310.09
4.3.70.0750.01010.09
4.3.60.0750.01010.09
4.3.50.0700.00810.09
4.3.40.0700.01310.09
4.3.30.0330.00710.09
4.3.20.0300.01010.09
4.3.10.0280.01010.09
4.3.00.0280.01010.09

preferences:
37.84 ms | 400 KiB | 5 Q