3v4l.org

run code in 300+ PHP versions simultaneously
<?php class obj implements arrayaccess { private $container = array(); public function __construct() { $this->container = array( "one" => 1, "two" => 2, "three" => 3, ); } public function offsetSet($offset, $value) { echo s_null($offset), $value; if (is_null($offset)) { $this->container[] = $value; } else { $this->container[$offset] = $value; } } public function offsetExists($offset) { return isset($this->container[$offset]); } public function offsetUnset($offset) { unset($this->container[$offset]); } public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } } $obj = new obj; $obj[0] = 'Append 1'; print_r($obj);

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.70.0110.00418.39
8.3.60.0130.00718.55
8.3.50.0180.01421.15
8.3.40.0140.00418.70
8.3.30.0140.00720.17
8.3.20.0040.00420.34
8.3.10.0060.00322.09
8.3.00.0000.00822.46
8.2.180.0180.00416.75
8.2.170.0110.00422.96
8.2.160.0100.00322.27
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00220.75
8.2.110.0030.00619.45
8.2.100.0080.00417.75
8.2.90.0050.00319.20
8.2.80.0080.00017.97
8.2.70.0030.00717.63
8.2.60.0030.00517.80
8.2.50.0040.00418.07
8.2.40.0040.00418.34
8.2.30.0040.00419.50
8.2.20.0030.00617.79
8.2.10.0080.00017.76
8.2.00.0000.00917.62
8.1.280.0130.00325.92
8.1.270.0070.00023.99
8.1.260.0100.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00622.05
8.1.230.0040.00718.95
8.1.220.0050.00517.74
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0060.00317.35
8.1.180.0000.00818.10
8.1.170.0030.00618.50
8.1.160.0030.00618.88
8.1.150.0040.00418.57
8.1.140.0060.00317.38
8.1.130.0030.00517.71
8.1.120.0000.00717.39
8.1.110.0000.00717.46
8.1.100.0040.00417.46
8.1.90.0000.00717.45
8.1.80.0000.00717.39
8.1.70.0000.00717.44
8.1.60.0080.00017.59
8.1.50.0040.00417.54
8.1.40.0070.00417.59
8.1.30.0040.00417.63
8.1.20.0050.00217.57
8.1.10.0000.00917.52
8.1.00.0040.00417.40
8.0.300.0070.00018.77
8.0.290.0000.00916.88
8.0.280.0030.00318.50
8.0.270.0000.00717.15
8.0.260.0030.00318.45
8.0.250.0000.00716.95
8.0.240.0040.00416.87
8.0.230.0040.00417.04
8.0.220.0070.00016.98
8.0.210.0040.00417.02
8.0.200.0070.00017.02
8.0.190.0040.00417.03
8.0.180.0000.00717.02
8.0.170.0050.00316.87
8.0.160.0050.00216.96
8.0.150.0000.00816.86
8.0.140.0100.00016.99
8.0.130.0060.00013.35
8.0.120.0050.00316.96
8.0.110.0070.00016.96
8.0.100.0040.00416.85
8.0.90.0040.00416.86
8.0.80.0030.01216.98
8.0.70.0070.00016.90
8.0.60.0050.00316.84
8.0.50.0080.00016.95
8.0.30.0120.00717.23
8.0.20.0130.00617.40
8.0.10.0050.00317.13
8.0.00.0110.00816.78
7.4.330.0020.00216.77
7.4.320.0000.00716.59
7.4.300.0030.00316.50
7.4.290.0040.00416.63
7.4.280.0030.00316.62
7.4.270.0070.00016.62
7.4.260.0050.00013.27
7.4.250.0030.00516.49
7.4.240.0060.00216.55
7.4.230.0030.00316.48
7.4.220.0150.00416.39
7.4.210.0080.00516.55
7.4.200.0000.00716.26
7.4.190.0030.00316.50
7.4.160.0070.01016.45
7.4.150.0180.00617.40
7.4.140.0080.00917.86
7.4.130.0100.00716.71
7.4.120.0100.00716.53
7.4.110.0030.01316.63
7.4.100.0140.00416.46
7.4.90.0100.00616.51
7.4.80.0170.00419.39
7.4.70.0070.01016.52
7.4.60.0100.00616.60
7.4.50.0030.00616.81
7.4.40.0040.00822.77
7.4.30.0060.00916.56
7.4.00.0030.01015.10
7.3.330.0050.00013.39
7.3.320.0050.00013.54
7.3.310.0040.00416.52
7.3.300.0000.00616.39
7.3.290.0060.00916.40
7.3.280.0080.01016.45
7.3.270.0100.00717.40
7.3.260.0150.00416.40
7.3.250.0060.01416.33
7.3.240.0100.01316.48
7.3.230.0040.01216.39
7.3.210.0060.01216.40
7.3.200.0130.00319.39
7.3.190.0150.00816.57
7.3.180.0030.01316.64
7.3.170.0060.01016.63
7.3.160.0030.01716.45
7.3.120.0030.01414.86
7.2.330.0070.01416.68
7.2.320.0160.00616.59
7.2.310.0060.01216.60
7.2.300.0120.00916.78
7.2.290.0060.01016.58
7.2.60.0000.01216.84
7.2.00.0070.00719.45
7.1.200.0040.00415.65
7.1.100.0000.01118.24
7.1.70.0090.00917.14
7.1.60.0100.01419.17
7.1.50.0070.01416.93
7.1.00.0070.05722.43
7.0.200.0000.00916.73
7.0.140.0030.07322.01
7.0.60.0400.04319.84
7.0.50.0100.07017.88
7.0.40.0170.07320.02
7.0.30.0570.06720.06
7.0.20.0200.07320.24
7.0.10.0170.06020.15
7.0.00.0230.04320.23
5.6.280.0030.07021.03
5.6.210.0100.03320.54
5.6.200.0200.07018.13
5.6.190.0070.07720.63
5.6.180.0300.04020.47
5.6.170.0130.04320.45
5.6.160.0070.08320.55
5.6.150.0200.07018.18
5.6.140.0070.04318.27
5.6.130.0070.05018.14
5.6.120.0000.05021.16
5.6.110.0130.07320.99
5.6.100.0170.06720.96
5.6.90.0130.08321.11
5.6.80.0130.07320.26
5.5.350.4070.04320.44
5.5.340.0100.06317.98
5.5.330.0130.07020.31
5.5.320.0300.07320.32
5.5.310.0270.08320.32
5.5.300.0100.06317.98
5.5.290.0030.04018.02
5.5.280.0000.09020.88
5.5.270.0070.04320.68
5.5.260.0030.04020.87
5.5.250.0130.07320.80
5.5.240.0030.07720.16
5.4.450.4400.03719.45
5.4.440.0200.04719.39
5.4.430.1630.04719.29
5.4.420.4070.05019.53
5.4.410.3870.03319.32
5.4.400.3600.03719.18
5.4.390.3530.03019.24
5.4.380.3400.04019.15
5.4.370.3430.04019.21
5.4.360.2870.03319.06
5.4.350.4030.04319.13
5.4.340.3430.04019.12
5.4.320.4200.04019.15
5.4.310.4000.05319.12
5.4.300.3870.03319.23
5.4.290.4100.02719.21
5.4.280.3570.04019.01
5.4.270.3730.03719.19
5.4.260.3770.03019.12
5.4.250.3830.04019.14
5.4.240.3770.04019.05
5.4.230.3730.04019.25
5.4.220.3530.04019.12
5.4.210.3600.04019.21
5.4.200.3830.03719.08
5.4.190.3930.03019.09
5.4.180.3770.04019.23
5.4.170.3830.03719.21
5.4.160.3900.03319.19
5.4.150.3800.04019.04
5.4.140.3830.03016.43
5.4.130.4200.03316.48
5.4.120.4270.03316.49
5.4.110.3870.03016.35
5.4.100.3830.03316.48
5.4.90.3800.03316.53
5.4.80.3200.03016.47
5.4.70.3600.03716.63
5.4.60.3600.03316.62
5.4.50.4170.04016.32
5.4.40.3630.03716.47
5.4.30.3870.03316.44
5.4.20.4100.04316.45
5.4.10.3870.03716.53
5.4.00.3930.03715.94
5.3.290.3830.04014.68
5.3.280.4000.03014.77
5.3.270.3800.04314.61
5.3.260.3870.03314.66
5.3.250.3630.03714.61
5.3.240.3730.04014.67
5.3.230.4570.03714.66
5.3.220.3730.03714.61
5.3.210.4300.03314.58
5.3.200.4400.03314.73
5.3.190.4070.03314.63
5.3.180.3600.03314.63
5.3.170.3770.03714.58
5.3.160.3500.04014.46
5.3.150.3930.04314.60
5.3.140.3530.04314.57
5.3.130.3900.03314.71
5.3.120.3670.03314.48
5.3.110.3900.03314.57
5.3.100.3600.03714.04
5.3.90.3930.03314.06
5.3.80.3930.03314.17
5.3.70.3900.03014.00
5.3.60.3830.05314.01
5.3.50.4870.03714.00
5.3.40.0170.04713.98
5.3.30.2030.03313.91
5.3.20.4300.04313.67
5.3.10.3770.03013.60
5.3.00.3830.04013.71
5.2.170.2200.03311.16
5.2.160.0070.06311.13
5.2.150.0070.06011.30
5.2.140.3100.03011.23
5.2.130.3300.03011.00
5.2.120.3270.02311.19
5.2.110.3400.03711.25
5.2.100.3400.03311.16
5.2.90.2800.03711.16
5.2.80.3200.02711.18
5.2.70.3100.03711.10
5.2.60.3370.03311.11
5.2.50.3130.03011.09
5.2.40.2700.03011.06
5.2.30.2570.03011.13
5.2.20.2430.02710.98
5.2.10.2430.03010.95
5.2.00.2500.03010.61
5.1.60.2670.0239.91
5.1.50.2000.02710.09
5.1.40.0000.03310.05
5.1.30.0030.03710.42
5.1.20.0030.05710.25
5.1.10.0000.03010.23
5.1.00.3930.02310.14
5.0.50.1700.0178.71
5.0.40.1700.0238.42
5.0.30.1530.0278.14
5.0.20.1400.0208.20
5.0.10.1230.0208.23
5.0.00.1270.0238.16
4.4.90.1230.0136.51
4.4.80.1300.0206.51
4.4.70.1330.0136.51
4.4.60.1330.0136.51
4.4.50.1200.0176.51
4.4.40.1370.0236.51
4.4.30.0000.0176.51
4.4.20.0000.0206.51
4.4.10.1670.0176.51
4.4.00.1430.0236.51
4.3.110.1700.0136.51
4.3.100.1370.0176.51
4.3.90.1230.0136.51
4.3.80.1230.0276.51
4.3.70.1230.0136.51
4.3.60.1170.0176.51
4.3.50.1170.0176.51
4.3.40.1200.0236.51
4.3.30.0600.0136.51
4.3.20.0830.0176.51
4.3.10.0630.0136.51
4.3.00.0600.0136.51

preferences:
32.46 ms | 401 KiB | 5 Q