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)); } }

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.0120.00916.63
8.3.50.0090.00722.04
8.3.40.0110.00318.84
8.3.30.0140.00018.97
8.3.20.0040.00420.34
8.3.10.0080.00023.48
8.3.00.0090.00020.73
8.2.180.0070.00718.16
8.2.170.0090.00622.96
8.2.160.0060.01222.09
8.2.150.0070.00724.18
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0040.00422.20
8.2.110.0030.00622.26
8.2.100.0040.00817.66
8.2.90.0000.00819.17
8.2.80.0030.00617.97
8.2.70.0090.00017.50
8.2.60.0000.00817.55
8.2.50.0000.00818.07
8.2.40.0030.00617.84
8.2.30.0000.00717.91
8.2.20.0000.00817.54
8.2.10.0000.00819.54
8.2.00.0030.00617.63
8.1.280.0100.01025.92
8.1.270.0080.00022.07
8.1.260.0060.00326.35
8.1.250.0070.00028.09
8.1.240.0030.00623.99
8.1.230.0070.00319.16
8.1.220.0030.00617.74
8.1.210.0090.00018.77
8.1.200.0060.00317.13
8.1.190.0000.00817.53
8.1.180.0000.00918.10
8.1.170.0030.00518.50
8.1.160.0100.00021.96
8.1.150.0000.00718.53
8.1.140.0070.00017.41
8.1.130.0030.00317.74
8.1.120.0040.00417.34
8.1.110.0040.00417.42
8.1.100.0000.00817.43
8.1.90.0060.00317.43
8.1.80.0000.00717.31
8.1.70.0070.00017.43
8.1.60.0080.00017.61
8.1.50.0040.00417.47
8.1.40.0000.00717.45
8.1.30.0030.00617.63
8.1.20.0060.00317.52
8.1.10.0050.00317.34
8.1.00.0000.00817.27
8.0.300.0040.00418.77
8.0.290.0030.00317.18
8.0.280.0040.00418.41
8.0.270.0000.00717.14
8.0.260.0050.00516.78
8.0.250.0060.00016.97
8.0.240.0060.00316.92
8.0.230.0030.00616.92
8.0.220.0080.00016.89
8.0.210.0070.00016.79
8.0.200.0060.00016.95
8.0.190.0060.00316.88
8.0.180.0000.00716.82
8.0.170.0000.00716.78
8.0.160.0000.00716.91
8.0.150.0080.00016.91
8.0.140.0030.00516.79
8.0.130.0030.00313.16
8.0.120.0000.00816.71
8.0.110.0040.00416.90
8.0.100.0050.00216.84
8.0.90.0000.00716.81
8.0.80.0060.01016.92
8.0.70.0040.00416.93
8.0.60.0040.00416.72
8.0.50.0050.00316.76
8.0.30.0120.01017.03
8.0.20.0100.00917.40
8.0.10.0070.00016.77
8.0.00.0160.00216.75
7.4.330.0050.00015.03
7.4.320.0030.00316.38
7.4.300.0040.00416.54
7.4.290.0030.00316.54
7.4.280.0000.00716.57
7.4.270.0030.00316.62
7.4.260.0040.00416.33
7.4.250.0000.00816.51
7.4.240.0050.00216.59
7.4.230.0000.00716.58
7.4.220.0030.02116.50
7.4.210.0070.00916.52
7.4.200.0040.00416.41
7.4.190.0000.00716.54
7.4.160.0080.00816.41
7.4.150.0160.00617.40
7.4.140.0050.01217.86
7.4.130.0090.01016.34
7.4.120.0110.00616.40
7.4.110.0150.00316.60
7.4.100.0040.01716.34
7.4.90.0050.01316.29
7.4.80.0100.00616.60
7.4.70.0100.00716.55
7.4.60.0060.00916.41
7.4.50.0000.00816.30
7.4.40.0080.00822.77
7.4.30.0070.01016.44
7.4.00.0070.01114.97
7.3.330.0050.00013.15
7.3.320.0060.00013.20
7.3.310.0030.00316.01
7.3.300.0030.00316.15
7.3.290.0150.00616.12
7.3.280.0070.01016.16
7.3.270.0120.00617.40
7.3.260.0120.00416.31
7.3.250.0050.01116.35
7.3.240.0030.01716.41
7.3.230.0060.01016.39
7.3.210.0060.01216.43
7.3.200.0130.00619.39
7.3.190.0040.01216.43
7.3.180.0090.00716.43
7.3.170.0100.00716.41
7.3.160.0110.00416.19
7.3.120.0060.00914.75
7.3.110.0090.00614.64
7.3.100.0040.01214.68
7.3.90.0060.00614.57
7.3.80.0060.00914.59
7.3.70.0040.00714.76
7.3.60.0000.01514.67
7.3.50.0070.00314.71
7.3.40.0030.00714.65
7.3.30.0110.00014.73
7.3.20.0070.00716.57
7.3.10.0030.01316.30
7.3.00.0110.00416.55
7.2.330.0100.00716.34
7.2.320.0100.00616.64
7.2.310.0070.01016.46
7.2.300.0090.00816.45
7.2.290.0120.00616.26
7.2.240.0070.01114.77
7.2.230.0070.01015.11
7.2.220.0060.00614.79
7.2.210.0080.00414.60
7.2.200.0030.00614.84
7.2.190.0030.01414.97
7.2.180.0060.00915.03
7.2.170.0110.00414.75
7.2.160.0120.00614.94
7.2.150.0070.01016.39
7.2.140.0030.00916.81
7.2.130.0030.01316.77
7.2.120.0030.01016.45
7.2.110.0000.01716.72
7.2.100.0100.00716.84
7.2.90.0030.01016.65
7.2.80.0040.01416.70
7.2.70.0030.01216.80
7.2.60.0060.00916.62
7.2.50.0030.00916.57
7.2.40.0110.00416.54
7.2.30.0060.01216.81
7.2.20.0060.00616.73
7.2.10.0070.00716.54
7.2.00.0050.00917.97
7.1.330.0030.01315.66
7.1.320.0030.01015.55
7.1.310.0060.00615.53
7.1.300.0090.00615.61
7.1.290.0050.00515.52
7.1.280.0030.00715.64
7.1.270.0070.00315.28
7.1.260.0070.00715.65
7.1.250.0050.00815.77
7.1.100.0000.00918.08
7.1.70.0030.00617.09
7.1.60.0040.01519.27
7.1.50.0160.00334.56
7.1.00.0030.07322.43
7.0.200.0000.00716.66
7.0.140.0000.07722.00
7.0.60.0030.04020.01
7.0.50.0030.03717.82
7.0.40.0000.09020.38
7.0.30.0370.07020.07
7.0.20.0330.07320.30
7.0.10.0070.04020.10
7.0.00.0030.08720.25
5.6.280.0100.06721.16
5.6.210.0130.06320.73
5.6.200.0030.04018.18
5.6.190.0070.04720.41
5.6.180.0500.06020.61
5.6.170.0300.05020.62
5.6.160.0030.06720.43
5.6.150.0130.07318.27
5.6.140.0070.03718.15
5.6.130.0000.08718.28
5.6.120.0100.08020.77
5.6.110.0070.05021.05
5.6.100.0170.07721.14
5.6.90.0070.07021.01
5.6.80.0070.04720.40
5.5.350.0170.06320.34
5.5.340.0070.05018.07
5.5.330.0070.08020.48
5.5.320.0030.04020.35
5.5.310.0370.06720.27
5.5.300.0100.06717.99
5.5.290.0100.07717.96
5.5.280.0100.08020.78
5.5.270.0170.05720.84
5.5.260.0170.04320.96
5.5.250.0030.05020.80
5.5.240.0270.06320.38
5.4.450.2770.04319.57
5.4.440.1430.04319.32
5.4.430.2600.03319.16
5.4.420.1770.04019.15
5.4.410.3230.03319.18
5.4.400.2470.03319.00
5.4.390.2370.03719.13
5.4.380.2830.04319.06
5.4.370.2930.04319.11
5.4.360.2970.04018.84
5.4.350.2200.03718.95
5.4.340.3130.04319.11
5.4.320.2730.04319.00
5.4.310.3600.04718.95
5.4.300.2570.04318.84
5.4.290.3470.03318.99
5.4.280.3330.04718.87
5.4.270.3130.03718.83
5.4.260.3330.04019.14
5.4.250.3000.03719.33
5.4.240.3530.03018.96
5.4.230.3170.03018.98
5.4.220.3230.03719.15
5.4.210.3230.03019.05
5.4.200.3030.04319.20
5.4.190.2700.04019.18
5.4.180.3700.04719.17
5.4.170.3300.04019.25
5.4.160.2930.04018.84
5.4.150.3000.04018.96
5.4.140.3300.04016.51
5.4.130.2930.03716.33
5.4.120.2930.04016.32
5.4.110.3130.03316.52
5.4.100.3330.03316.36
5.4.90.2930.04016.54
5.4.80.3070.04016.54
5.4.70.3000.04016.50
5.4.60.3670.04016.56
5.4.50.3070.04016.33
5.4.40.3600.04716.52
5.4.30.3030.04016.50
5.4.20.3130.03316.16
5.4.10.3270.03316.26
5.4.00.3270.03715.81
5.3.290.3200.04314.64
5.3.280.3330.03014.59
5.3.270.2700.03714.69
5.3.260.2730.03314.70
5.3.250.3370.04014.52
5.3.240.2930.03314.62
5.3.230.2900.03714.58
5.3.220.2970.04014.50
5.3.210.3170.03714.65
5.3.200.2670.03314.59
5.3.190.2930.04014.43
5.3.180.3000.03714.47
5.3.170.3130.03014.80
5.3.160.3370.03714.47
5.3.150.2900.03314.55
5.3.140.2930.04014.66
5.3.130.3130.04014.56
5.3.120.3130.04314.56
5.3.110.3200.04314.54
5.3.100.3430.04314.02
5.3.90.3400.03013.94
5.3.80.3030.03714.19
5.3.70.3430.03313.89
5.3.60.2770.04014.02
5.3.50.3500.03014.07
5.3.40.3400.03313.86
5.3.30.3370.03713.84
5.3.20.2600.03713.62
5.3.10.3130.03713.89
5.3.00.3170.03713.57
5.2.170.2570.03311.08
5.2.160.2400.03311.24
5.2.150.2830.02711.29
5.2.140.2770.02311.30
5.2.130.2100.03011.02
5.2.120.2600.03011.05
5.2.110.2900.03011.23
5.2.100.2800.03011.03
5.2.90.0130.06011.24
5.2.80.0070.02311.01
5.2.70.0000.03011.00
5.2.60.0000.05711.15
5.2.50.1630.03011.26
5.2.40.2130.03010.94
5.2.30.1970.03311.03
5.2.20.2170.03010.89
5.2.10.2070.02710.77
5.2.00.1900.02310.78
5.1.60.1970.02010.23
5.1.50.2130.0239.91
5.1.40.2030.02710.22
5.1.30.2070.02310.46
5.1.20.1970.03010.34
5.1.10.2370.02310.06
5.1.00.2100.02310.07
5.0.50.1000.0238.53
5.0.40.1170.0208.50
5.0.30.1270.0378.15
5.0.20.1100.0138.18
5.0.10.1000.0208.40
5.0.00.1030.0308.25
4.4.90.1230.0236.55
4.4.80.1000.0176.55
4.4.70.1030.0136.55
4.4.60.0570.0136.55
4.4.50.1130.0236.55
4.4.40.1330.0306.55
4.4.30.1270.0206.55
4.4.20.1270.0206.55
4.4.10.1170.0106.55
4.4.00.0800.0276.55
4.3.110.1330.0136.55
4.3.100.1030.0236.55
4.3.90.1500.0136.55
4.3.80.1170.0276.56
4.3.70.1330.0136.57
4.3.60.1070.0136.58
4.3.50.0970.0206.58
4.3.40.1030.0236.59
4.3.30.0600.0206.59
4.3.20.0600.0136.59
4.3.10.0600.0176.59
4.3.00.0700.0276.59

preferences:
41.4 ms | 401 KiB | 5 Q