3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myData implements IteratorAggregate { public $property1 = "Public property one"; public $property2 = "Public property two"; public $property3 = "Public property three"; public function __construct() { $this->property4 = "last property"; } public function getIterator() { return new ArrayIterator($this); } } $obj = new myData; echo "foreach (new \$obj)\n"; foreach($obj as $key => $value) { var_dump($key, $value); echo "\n"; } echo "\nforeach (new ArrayIterator(\$obj))\n"; foreach(new ArrayIterator($obj) as $key => $value) { var_dump($key, $value); echo "\n"; }

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.0100.00718.81
8.3.50.0120.00321.21
8.3.40.0150.00318.77
8.3.30.0110.00419.05
8.3.20.0000.00720.33
8.3.10.0040.00421.92
8.3.00.0050.00322.44
8.2.180.0110.00425.92
8.2.170.0140.00422.96
8.2.160.0000.01319.08
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.01126.16
8.2.120.0060.00319.23
8.2.110.0060.00322.23
8.2.100.0120.00417.84
8.2.90.0080.00019.22
8.2.80.0100.00018.04
8.2.70.0090.00017.63
8.2.60.0000.00817.68
8.2.50.0040.00418.07
8.2.40.0000.00718.16
8.2.30.0000.00818.13
8.2.20.0030.00617.66
8.2.10.0080.00017.75
8.2.00.0040.00417.75
8.1.280.0070.01125.92
8.1.270.0080.00022.18
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0100.00023.76
8.1.230.0030.00919.16
8.1.220.0080.00017.74
8.1.210.0030.00518.77
8.1.200.0070.00317.48
8.1.190.0050.00317.52
8.1.180.0080.00020.52
8.1.170.0060.00320.25
8.1.160.0000.00822.06
8.1.150.0080.00018.61
8.1.140.0000.00817.36
8.1.130.0070.00017.75
8.1.120.0090.00017.46
8.1.110.0060.00317.34
8.1.100.0040.00417.45
8.1.90.0040.00417.34
8.1.80.0000.00717.35
8.1.70.0030.00317.48
8.1.60.0040.00417.57
8.1.50.0030.00617.43
8.1.40.0040.00417.44
8.1.30.0040.00417.66
8.1.20.0040.00417.48
8.1.10.0030.00617.48
8.1.00.0040.00417.40
8.0.300.0080.00018.77
8.0.290.0070.00017.05
8.0.280.0070.00018.49
8.0.270.0000.00717.31
8.0.260.0080.00016.83
8.0.250.0030.00316.98
8.0.240.0040.00416.85
8.0.230.0030.00316.89
8.0.220.0030.00616.92
8.0.210.0030.00316.87
8.0.200.0050.00216.84
8.0.190.0040.00416.95
8.0.180.0030.00316.86
8.0.170.0030.00516.87
8.0.160.0060.00316.82
8.0.150.0040.00416.77
8.0.140.0000.00716.82
8.0.130.0000.00513.37
8.0.120.0030.00516.79
8.0.110.0050.00316.96
8.0.100.0040.00416.73
8.0.90.0030.00516.94
8.0.80.0040.01116.91
8.0.70.0040.00416.85
8.0.60.0000.00716.77
8.0.50.0070.00016.70
8.0.30.0100.01017.19
8.0.20.0100.00917.40
8.0.10.0000.00716.84
8.0.00.0090.01116.64
7.4.330.0060.00015.00
7.4.320.0030.00316.59
7.4.300.0000.00616.64
7.4.290.0000.00716.41
7.4.280.0030.00316.50
7.4.270.0070.00016.45
7.4.260.0040.00416.59
7.4.250.0070.00016.49
7.4.240.0020.00516.57
7.4.230.0030.00316.70
7.4.220.0200.00716.56
7.4.210.0120.00316.64
7.4.200.0070.00016.72
7.4.190.0000.00716.46
7.4.160.0100.00516.38
7.4.150.0070.01317.40
7.4.140.0140.00417.86
7.4.130.0100.00816.57
7.4.120.0100.00816.64
7.4.110.0140.00316.73
7.4.100.0120.00816.49
7.4.90.0040.01416.44
7.4.80.0030.01319.39
7.4.70.0130.01016.50
7.4.60.0060.01216.59
7.4.50.0050.00316.56
7.4.40.0100.00322.77
7.4.30.0120.00916.52
7.4.00.0130.00314.70
7.3.330.0050.00013.28
7.3.320.0020.00213.26
7.3.310.0070.00016.19
7.3.300.0030.00316.21
7.3.290.0000.01416.28
7.3.280.0070.01016.30
7.3.270.0170.00017.40
7.3.260.0100.01316.45
7.3.250.0120.00816.33
7.3.240.0030.01316.69
7.3.230.0060.01516.39
7.3.210.0080.01116.29
7.3.200.0130.00416.42
7.3.190.0050.01516.38
7.3.180.0070.01316.63
7.3.170.0120.00316.40
7.3.160.0090.00616.50
7.3.120.0070.01015.03
7.2.330.0070.01416.72
7.2.320.0080.01716.66
7.2.310.0030.01316.51
7.2.300.0150.00316.70
7.2.290.0100.00716.67
7.1.100.0030.01018.09
7.1.70.0030.00717.15
7.1.60.0090.01519.82
7.1.50.0050.00516.93
7.1.00.0030.03322.54
7.0.200.0040.00416.80
7.0.140.0070.07322.00
7.0.60.0000.04720.02
7.0.50.0100.07017.95
7.0.40.0130.07020.23
7.0.30.0300.06720.13
7.0.20.0230.08320.22
7.0.10.0330.07720.23
7.0.00.0030.04720.23
5.6.280.0030.07020.90
5.6.210.0100.04720.49
5.6.200.0030.04018.14
5.6.190.0130.06720.33
5.6.180.3800.03720.33
5.6.170.0230.08020.55
5.6.160.0030.08320.50
5.6.150.0070.05318.25
5.6.140.0000.04018.17
5.6.130.0000.04318.17
5.6.120.0170.07321.13
5.6.110.0070.08021.12
5.6.100.0100.08321.13
5.6.90.0130.08021.00
5.6.80.0030.04020.51
5.6.70.0170.04320.29
5.5.350.0200.05720.42
5.5.340.0000.04317.96
5.5.330.0070.06320.40
5.5.320.0200.05020.30
5.5.310.0330.07320.37
5.5.300.0100.04317.95
5.5.290.0030.08318.04
5.5.280.0200.05720.86
5.5.270.0030.04020.77
5.5.260.0130.05020.82
5.5.250.0030.08020.70
5.5.240.0070.06720.12
5.4.450.0700.06319.38
5.4.440.0830.05019.70
5.4.430.0470.04319.47
5.4.420.0770.04719.58
5.4.410.0100.05319.39
5.4.400.0400.04318.77
5.4.390.0330.05718.57
5.4.380.0270.05318.73
5.4.370.0230.04318.47
5.4.360.0070.06018.57
5.4.350.0200.05018.54
5.4.340.0200.04718.63
5.4.320.0030.05012.51
5.4.310.0070.04312.50
5.4.300.0100.04312.50
5.4.290.0040.03812.50
5.4.280.0070.03712.40
5.4.270.0090.04312.40
5.4.260.0130.05019.00
5.4.250.0170.05018.74
5.4.240.0130.07319.00
5.4.230.0070.05719.02
5.4.220.0230.04018.61
5.4.210.0030.05718.95
5.4.200.0100.05019.02
5.4.190.0030.06018.98
5.4.180.0100.05018.80
5.4.170.0100.07318.77
5.4.160.0300.04318.98
5.4.150.0170.05018.95
5.4.140.0130.04316.46
5.4.130.0130.05716.58
5.4.120.0130.07016.44
5.4.110.0030.05316.59
5.4.100.0170.05716.59
5.4.90.0100.04716.53
5.4.80.0100.05016.53
5.4.70.0100.05316.39
5.4.60.0130.05316.46
5.4.50.0200.06716.36
5.4.40.0100.06716.67
5.4.30.0000.05316.41
5.4.20.0030.05716.30
5.4.10.0200.06316.46
5.4.00.0070.07015.76
5.3.290.0090.03512.80
5.3.280.0070.05314.57
5.3.270.0130.08014.70
5.3.260.0100.05014.78
5.3.250.0070.06014.60
5.3.240.0130.06014.69
5.3.230.0100.05314.74
5.3.220.0030.06714.58
5.3.210.0000.06014.64
5.3.200.0100.04714.66
5.3.190.0200.06014.79
5.3.180.0100.04714.79
5.3.170.0170.06014.66
5.3.160.0100.05014.56
5.3.150.0070.05314.55
5.3.140.0130.06714.75
5.3.130.0200.04714.54
5.3.120.0030.06014.64
5.3.110.0070.07314.56
5.3.100.0130.06014.27
5.3.90.0170.05014.20
5.3.80.0070.05313.93
5.3.70.0170.06014.00
5.3.60.0070.05313.90
5.3.50.0270.05314.04
5.3.40.0070.06014.04
5.3.30.0100.06713.92
5.3.20.0070.06013.76
5.3.10.0170.05713.73
5.3.00.0030.06713.62
5.2.170.0100.04310.97
5.2.160.0130.03711.11
5.2.150.0070.05711.14
5.2.140.0130.04011.14
5.2.130.0100.04311.15
5.2.120.0130.05711.19
5.2.110.0030.04311.00
5.2.100.0130.03311.07
5.2.90.0030.04311.29
5.2.80.0070.04011.14
5.2.70.0100.04011.26
5.2.60.0130.04310.88
5.2.50.0000.05011.11
5.2.40.0030.04011.08
5.2.30.0100.04710.97
5.2.20.0100.04011.03
5.2.10.0030.05010.93
5.2.00.0170.04010.81
5.1.60.0070.0479.96
5.1.50.0070.0479.93
5.1.40.0130.03310.18
5.1.30.0030.05710.41
5.1.20.0030.04010.18
5.1.10.0030.05310.04
5.1.00.0030.04010.04
5.0.50.0030.0338.54
5.0.40.0030.0338.61
5.0.30.0070.0478.28
5.0.20.0070.0308.12
5.0.10.0000.0308.22
5.0.00.0070.0438.26
4.4.90.0030.0207.34
4.4.80.0030.0207.34
4.4.70.0000.0237.34
4.4.60.0000.0277.34
4.4.50.0030.0207.34
4.4.40.0030.0337.34
4.4.30.0000.0307.34
4.4.20.0030.0237.34
4.4.10.0000.0307.34
4.4.00.0030.0437.34
4.3.110.0100.0177.34
4.3.100.0070.0237.34
4.3.90.0100.0277.34
4.3.80.0130.0337.34
4.3.70.0030.0337.34
4.3.60.0030.0307.34
4.3.50.0030.0307.34
4.3.40.0000.0377.34
4.3.30.0030.0207.34
4.3.20.0000.0237.34
4.3.10.0030.0207.34
4.3.00.0030.0207.90

preferences:
38.04 ms | 401 KiB | 5 Q