3v4l.org

run code in 300+ PHP versions simultaneously
<?php class obj implements \ArrayAccess , \IteratorAggregate { public function __construct() { foreach(array("one" => 1, "two" => 2, "three" => 3) as $offset => $value) $this->{$offset} = $value; } public function offsetSet($offset, $value) { $this->{$offset} = $value; } public function offsetExists($offset) { return isset($this->{$offset}); } public function offsetUnset($offset) { unset($this->{$offset}); } public function offsetGet($offset) { return isset($this->{$offset}) ? $this->{$offset} : null; } function getIterator() { return new \ArrayIterator($this); } } $obj = new obj; foreach($obj as $offset => $value) unset($obj[$offset]); print_r($obj); foreach(get_object_vars($obj) as $offset => $value) unset($obj[$offset]); 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.0090.00916.88
8.3.60.0110.00416.63
8.3.50.0130.00816.52
8.3.40.0140.00018.84
8.3.30.0060.00918.87
8.3.20.0030.00618.59
8.3.10.0080.00020.70
8.3.00.0000.00817.50
8.2.180.0140.00418.39
8.2.170.0150.00022.96
8.2.160.0100.00722.08
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0050.00226.16
8.2.120.0040.00419.96
8.2.110.0030.00620.96
8.2.100.0060.00617.84
8.2.90.0070.00019.17
8.2.80.0090.00018.05
8.2.70.0050.00317.50
8.2.60.0040.00418.05
8.2.50.0090.00018.07
8.2.40.0000.00819.84
8.2.30.0040.00418.25
8.2.20.0000.00717.61
8.2.10.0040.00417.66
8.2.00.0040.00417.84
8.1.280.0070.00725.92
8.1.270.0000.00824.66
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0070.00322.46
8.1.230.0000.01120.89
8.1.220.0050.00318.77
8.1.210.0030.00618.95
8.1.200.0030.00617.35
8.1.190.0000.00817.51
8.1.180.0030.00518.10
8.1.170.0040.00418.75
8.1.160.0040.00418.81
8.1.150.0070.00418.66
8.1.140.0040.00417.37
8.1.130.0030.00317.75
8.1.120.0000.00717.53
8.1.110.0040.00417.48
8.1.100.0000.00717.44
8.1.90.0030.00417.34
8.1.80.0040.00417.47
8.1.70.0040.00417.42
8.1.60.0050.00317.62
8.1.50.0050.00317.39
8.1.40.0050.00317.53
8.1.30.0000.00917.64
8.1.20.0000.00817.64
8.1.10.0000.00817.55
8.1.00.0050.00317.43
8.0.300.0000.00719.98
8.0.290.0000.00816.63
8.0.280.0030.00318.46
8.0.270.0070.00017.27
8.0.260.0040.00416.88
8.0.250.0040.00416.87
8.0.240.0080.00017.00
8.0.230.0000.00816.97
8.0.220.0040.00416.85
8.0.210.0000.00716.93
8.0.200.0030.00316.86
8.0.190.0000.00716.93
8.0.180.0000.00716.82
8.0.170.0080.00016.79
8.0.160.0000.00716.79
8.0.150.0040.00416.78
8.0.140.0000.00716.86
8.0.130.0000.00713.30
8.0.120.0070.00016.84
8.0.110.0000.00716.79
8.0.100.0000.00816.95
8.0.90.0040.00416.98
8.0.80.0030.01216.87
8.0.70.0000.00716.78
8.0.60.0030.00316.80
8.0.50.0070.00016.70
8.0.30.0140.00417.01
8.0.20.0070.01217.23
8.0.10.0000.00716.97
8.0.00.0120.00516.65
7.4.330.0000.00614.68
7.4.320.0000.00616.50
7.4.300.0000.00716.62
7.4.290.0040.00416.64
7.4.280.0060.00316.59
7.4.270.0030.00316.45
7.4.260.0000.00513.23
7.4.250.0050.00216.50
7.4.240.0030.00316.54
7.4.230.0000.00716.59
7.4.220.0130.00316.71
7.4.210.0090.00916.61
7.4.200.0030.00316.64
7.4.190.0020.00516.75
7.4.160.0080.00816.58
7.4.150.0110.00717.07
7.4.140.0100.01017.18
7.4.130.0130.00616.47
7.4.120.0140.00716.63
7.4.110.0100.00716.38
7.4.100.0030.01516.43
7.4.90.0060.01116.50
7.4.80.0040.01218.63
7.4.70.0030.01216.46
7.4.60.0100.00716.39
7.4.50.0060.00322.14
7.4.40.0000.01421.69
7.4.30.0060.00916.45
7.4.00.0060.00614.91
7.3.330.0060.00013.19
7.3.320.0030.00313.20
7.3.310.0000.00716.21
7.3.300.0030.00316.23
7.3.290.0000.01316.33
7.3.280.0040.01216.37
7.3.270.0150.00317.07
7.3.260.0090.01118.24
7.3.250.0120.01116.27
7.3.240.0150.00316.66
7.3.230.0080.00816.57
7.3.210.0070.01116.38
7.3.200.0100.01019.39
7.3.190.0110.01116.31
7.3.180.0130.00316.49
7.3.170.0070.01016.35
7.3.160.0040.01116.41
7.3.120.0110.00714.96
7.3.110.0070.01014.76
7.3.100.0030.01015.03
7.3.90.0100.00314.59
7.3.80.0000.01015.17
7.3.70.0000.00814.76
7.3.60.0070.00714.66
7.3.50.0100.01014.94
7.3.40.0060.00614.95
7.3.30.0080.00414.78
7.3.20.0060.01016.75
7.3.10.0090.00616.78
7.3.00.0040.00716.88
7.2.330.0040.01216.36
7.2.320.0090.00616.55
7.2.310.0180.00616.59
7.2.300.0090.00916.70
7.2.290.0160.00616.80
7.2.240.0080.00815.17
7.2.230.0090.00614.90
7.2.220.0060.00614.98
7.2.210.0000.01015.01
7.2.200.0040.01115.13
7.2.190.0090.00914.88
7.2.180.0060.01214.89
7.2.170.0000.00814.95
7.2.160.0000.01215.06
7.2.150.0060.00916.83
7.2.140.0060.00617.01
7.2.130.0060.00617.14
7.2.120.0000.00916.80
7.2.110.0060.00316.89
7.2.100.0100.00717.03
7.2.90.0050.00916.97
7.2.80.0110.00716.70
7.2.70.0070.00717.04
7.2.60.0070.00816.98
7.2.50.0070.00416.80
7.2.40.0040.00716.95
7.2.30.0110.00716.89
7.2.20.0030.01417.07
7.2.10.0000.01417.05
7.2.00.0050.00718.25
7.1.330.0150.00315.91
7.1.320.0030.01015.96
7.1.310.0060.00615.87
7.1.300.0100.01015.71
7.1.290.0070.00315.69
7.1.280.0080.00315.75
7.1.270.0060.00615.76
7.1.260.0070.00315.77
7.1.250.0060.00915.77
7.1.200.0040.00815.85
7.1.100.0060.00618.00
7.1.70.0000.00717.16
7.1.60.0100.01419.40
7.1.50.0130.01017.04
7.1.00.0070.07322.27
7.0.200.0060.00316.64
7.0.140.0070.07022.11
7.0.120.0030.03022.17
7.0.90.0070.08319.88
7.0.80.0330.07319.99
7.0.70.0570.07319.86
7.0.60.0500.08720.08
7.0.50.0570.08320.37
7.0.40.0000.08020.14
7.0.30.0100.08020.04
7.0.20.0130.07320.15
7.0.10.0000.08019.94
7.0.00.0070.09020.09
5.6.280.0100.06720.87
5.6.230.0100.07020.64
5.6.220.0030.04320.58
5.6.210.0070.05020.67
5.6.200.0000.09020.98
5.6.190.0100.05721.09
5.6.180.0030.08720.96
5.6.170.0070.09021.05
5.6.160.0130.05321.09
5.6.150.0130.07721.12
5.6.140.0130.08021.11
5.6.130.0030.05321.11
5.6.120.0000.08721.11
5.6.110.0100.07721.08
5.6.100.0170.05721.16
5.6.90.0200.06720.99
5.6.80.0170.07020.35
5.6.70.0070.04320.47
5.6.60.0130.07320.33
5.6.50.0130.06720.47
5.6.40.0100.07720.51
5.6.30.0130.07320.44
5.6.20.0100.07720.32
5.6.10.0130.06720.30
5.6.00.0100.06720.45
5.5.370.0000.08720.58
5.5.360.0070.07020.40
5.5.350.0030.04720.43
5.5.340.0130.07720.77
5.5.330.0070.07320.77
5.5.320.0070.05320.87
5.5.310.0100.04720.89
5.5.300.0130.07720.92
5.5.290.0030.08020.64
5.5.280.0100.06020.79
5.5.270.0030.08720.91
5.5.260.0100.05320.86
5.5.250.0000.05320.46
5.5.240.0000.05720.32
5.5.230.0100.05320.22
5.5.220.0030.08320.24
5.5.210.0070.07320.03
5.5.200.0100.07020.14
5.5.190.0130.07320.28
5.5.180.0070.06720.23
5.5.160.0130.06020.22
5.5.150.0070.07720.21
5.5.140.0130.07320.16
5.5.130.0030.04320.09
5.5.120.0030.08320.23
5.5.110.0130.05720.27
5.5.100.0130.03719.99
5.5.90.0100.07320.09
5.5.80.0030.07320.11
5.5.70.0100.06720.11
5.5.60.0100.06720.06
5.5.50.0170.07320.05
5.5.40.0100.07020.04
5.5.30.0000.08020.14
5.5.20.0030.07720.04
5.5.10.0130.07020.01
5.5.00.0030.08320.04
5.4.450.0070.04019.42
5.4.440.0100.05719.20
5.4.430.0100.07319.44
5.4.420.0070.08019.38
5.4.410.0070.07319.32
5.4.400.0030.04718.91
5.4.390.0030.07018.95
5.4.380.0100.06019.13
5.4.370.0070.07718.85
5.4.360.0000.07718.91
5.4.350.0130.06718.90
5.4.340.0070.07019.04
5.4.320.0070.07319.07
5.4.310.0130.07718.84
5.4.300.0100.07319.03
5.4.290.0130.07019.05
5.4.280.0170.06719.02
5.4.270.0070.06718.84
5.4.260.0030.04019.09
5.4.250.0070.03318.84
5.4.240.0030.07018.94
5.4.230.0030.08019.11
5.4.220.0070.05718.84
5.4.210.0030.06719.14
5.4.200.0070.07719.04
5.4.190.0130.04018.93
5.4.180.0000.07718.89
5.4.170.0030.08018.87
5.4.160.0030.07719.16
5.4.150.0070.06719.16
5.4.140.0070.03316.33
5.4.130.0070.03716.37
5.4.120.0100.06716.46
5.4.110.0070.05016.39
5.4.100.0100.04316.50
5.4.90.0100.06716.29
5.4.80.0030.04016.34
5.4.70.0070.07716.37
5.4.60.0030.07716.37
5.4.50.0030.06716.40
5.4.40.0030.05016.27
5.4.30.0030.07316.29
5.4.20.0070.06716.45
5.4.10.0030.05016.40
5.4.00.0070.06715.90
5.3.290.0100.07014.73
5.3.280.0100.04714.54
5.3.270.0030.07314.68
5.3.260.0030.06314.73
5.3.250.0070.04714.59
5.3.240.0100.06314.55
5.3.230.0100.05014.66
5.3.220.0030.08314.50
5.3.210.0130.07014.67
5.3.200.0100.06314.64
5.3.190.0070.07714.72
5.3.180.0130.06714.64
5.3.170.0030.05014.53
5.3.160.0070.08014.69
5.3.150.0070.07314.63
5.3.140.0030.05714.52
5.3.130.0130.07014.55
5.3.120.0170.06714.59
5.3.110.0070.07314.65
5.3.100.0100.07314.06
5.3.90.0030.05313.95
5.3.80.0070.05014.05
5.3.70.0070.07713.92
5.3.60.0070.07013.91
5.3.50.0070.07313.94
5.3.40.0000.07013.88
5.3.30.0070.05314.01
5.3.20.0100.06713.60
5.3.10.0000.06013.75
5.3.00.0070.07013.63
5.2.170.0030.05313.59
5.2.160.0070.06313.59
5.2.150.0070.06313.59
5.2.140.0030.06713.59
5.2.130.0070.06313.59
5.2.120.0030.06713.59
5.2.110.0030.06313.59
5.2.100.0100.06013.59
5.2.90.0070.06013.59
5.2.80.0030.04313.59
5.2.70.0000.03313.59
5.2.60.0100.05713.59
5.2.50.0030.04013.59
5.2.40.0000.03713.59
5.2.30.0070.06013.59
5.2.20.0070.03013.59
5.2.10.0100.05713.59
5.2.00.0100.04013.59
5.1.60.0030.05313.59
5.1.50.0070.05313.59
5.1.40.0030.05713.59
5.1.30.0070.05313.59
5.1.20.0030.05713.59
5.1.10.0070.03313.59
5.1.00.0030.05313.59
5.0.50.0000.04013.59
5.0.40.0000.03713.59
5.0.30.0030.05013.59
5.0.20.0030.04713.59
5.0.10.0030.04313.59
5.0.00.0170.05013.59
4.4.90.0000.02313.59
4.4.80.0000.02313.59
4.4.70.0000.03713.59
4.4.60.0030.03313.59
4.4.50.0000.04013.59
4.4.40.0030.04013.59
4.4.30.0100.02313.59
4.4.20.0030.02313.59
4.4.10.0030.03713.59
4.4.00.0000.05313.59
4.3.110.0000.04013.59
4.3.100.0030.03313.59
4.3.90.0070.03013.59
4.3.80.0000.05713.59
4.3.70.0000.03013.59
4.3.60.0100.02013.59
4.3.50.0070.03013.59
4.3.40.0000.05313.59
4.3.30.0000.03713.59
4.3.20.0000.03313.59
4.3.10.0000.03313.59
4.3.00.0000.03713.59

preferences:
54.99 ms | 401 KiB | 5 Q