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); } } class myIterator implements Iterator { private $position = 0; private $array = array('one', 'two', 'three'); function rewind() { $this->position = 0; } function current() { return $this->array[$this->position]; } function key() { return $this->position; } function next() { ++$this->position; } function valid() { return isset($this->array[$this->position]); } } $renderFunction = function($iterator) { foreach($iterator as $key => $value) { echo "$key: $value\n"; foreach($iterator as $key => $value) { echo " $key: $value\n"; } } }; echo "-----IteratorAggregate-----\n"; $renderFunction(new myData); echo "\n-----Iterator-----\n"; $renderFunction(new myIterator);

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.4.120.0040.00520.73
8.4.110.0120.00920.65
8.4.100.0160.00517.71
8.4.90.0160.00517.77
8.4.80.0050.00418.20
8.4.70.0060.01017.83
8.4.60.0140.00718.71
8.4.50.0150.00518.50
8.4.40.0140.00717.81
8.4.30.0160.00319.76
8.4.20.0100.00719.74
8.4.10.0030.00619.88
8.3.250.0120.00719.10
8.3.240.0120.00716.95
8.3.230.0120.00816.91
8.3.220.0080.00216.78
8.3.210.0120.00916.67
8.3.200.0080.00416.89
8.3.190.0090.01017.13
8.3.180.0060.00316.71
8.3.170.0120.00620.57
8.3.160.0040.01117.41
8.3.150.0060.00319.00
8.3.140.0040.00416.57
8.3.130.0060.00318.72
8.3.120.0090.00919.06
8.3.110.0000.00920.94
8.3.100.0080.00024.06
8.3.90.0130.00726.77
8.3.80.0090.00016.75
8.3.70.0070.01518.68
8.3.60.0090.00616.86
8.3.50.0130.00523.01
8.3.40.0070.00719.01
8.3.30.0120.00318.66
8.3.20.0080.00018.67
8.3.10.0040.00421.71
8.3.00.0030.00620.68
8.2.290.0130.00720.21
8.2.280.0070.00718.39
8.2.270.0150.00318.21
8.2.260.0030.01319.21
8.2.250.0150.00318.46
8.2.240.0100.01316.96
8.2.230.0040.00422.58
8.2.220.0080.00437.54
8.2.210.0100.01026.77
8.2.200.0030.00616.63
8.2.190.0090.01216.75
8.2.180.0090.00925.92
8.2.170.0060.00918.92
8.2.160.0110.00722.96
8.2.150.0000.00825.66
8.2.140.0030.00624.66
8.2.130.0040.00421.19
8.2.120.0040.00426.16
8.2.110.0080.00422.21
8.2.100.0080.00418.03
8.2.90.0000.00817.91
8.2.80.0090.00019.29
8.2.70.0030.00517.63
8.2.60.0030.00517.48
8.2.50.0030.00618.34
8.2.40.0050.00320.25
8.2.30.0000.00719.40
8.2.20.0040.00418.08
8.2.10.0000.00718.03
8.2.00.0030.00517.68
8.1.330.0090.01016.79
8.1.320.0110.00816.34
8.1.310.0040.01418.69
8.1.300.0100.00020.25
8.1.290.0030.00618.88
8.1.280.0120.00925.92
8.1.270.0040.00424.66
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0070.00322.39
8.1.230.0110.00022.66
8.1.220.0080.00017.77
8.1.210.0030.00618.77
8.1.200.0050.00317.35
8.1.190.0060.00917.00
8.1.180.0000.00818.10
8.1.170.0040.00418.49
8.1.160.0050.00218.79
8.1.150.0080.00022.11
8.1.140.0070.00019.61
8.1.130.0000.00717.38
8.1.120.0030.00617.49
8.1.110.0000.00817.54
8.1.100.0000.00817.37
8.1.90.0030.00517.38
8.1.80.0000.00717.50
8.1.70.0000.00717.47
8.1.60.0040.00417.59
8.1.50.0040.00417.50
8.1.40.0040.00417.58
8.1.30.0030.00517.59
8.1.20.0000.00917.72
8.1.10.0040.00417.59
8.1.00.0050.00217.52
8.0.300.0040.00419.98
8.0.290.0060.00316.75
8.0.280.0040.00418.47
8.0.270.0030.00317.21
8.0.260.0060.00017.34
8.0.250.0030.00316.99
8.0.240.0070.00016.96
8.0.230.0000.00716.90
8.0.220.0000.00716.91
8.0.210.0000.00716.90
8.0.200.0020.00516.93
8.0.190.0040.00416.84
8.0.180.0040.00416.83
8.0.170.0050.00216.91
8.0.160.0000.00816.88
8.0.150.0070.00016.76
8.0.140.0000.00716.77
8.0.130.0020.00615.10
8.0.120.0060.00516.90
8.0.110.0070.00316.85
8.0.100.0050.00316.83
8.0.90.0040.00416.79
8.0.80.0060.00616.88
8.0.70.0070.00616.91
8.0.60.0090.00316.85
8.0.50.0070.00716.86
8.0.30.0120.00817.06
8.0.20.0110.00817.29
8.0.10.0040.00916.95
8.0.00.0080.00616.92
7.4.330.0000.00515.55
7.4.320.0070.00016.61
7.4.300.0060.00016.61
7.4.290.0000.00816.56
7.4.280.0030.00416.41
7.4.270.0030.00316.61
7.4.260.0060.00116.58
7.4.250.0080.00616.58
7.4.240.0110.00316.50
7.4.230.0100.00616.65
7.4.220.0130.00616.48
7.4.210.0090.00816.65
7.4.200.0110.00216.56
7.4.190.0140.00316.50
7.4.180.0090.00916.57
7.4.160.0120.00616.46
7.4.150.0060.01116.98
7.4.140.0130.00617.51
7.4.130.0090.00916.54
7.4.120.0110.00716.58
7.4.110.0140.00316.50
7.4.100.0130.00516.61
7.4.90.0100.00616.52
7.4.80.0110.00617.97
7.4.70.0140.00516.51
7.4.60.0080.00816.49
7.4.50.0110.00316.42
7.4.40.0080.00916.41
7.4.30.0130.00316.48
7.4.20.0120.00516.43
7.4.10.0090.00816.44
7.4.00.0090.00915.73
7.3.330.0050.00714.75
7.3.320.0110.00214.82
7.3.310.0110.00216.27
7.3.300.0060.00416.38
7.3.290.0060.00916.36
7.3.280.0100.00816.40
7.3.270.0150.00516.94
7.3.260.0130.00716.37
7.3.250.0150.00516.45
7.3.240.0120.00716.55
7.3.230.0100.01016.53
7.3.220.0170.00516.18
7.3.210.0100.00916.38
7.3.200.0140.00816.46
7.3.190.0140.00716.31
7.3.180.0100.00716.33
7.3.170.0090.00616.37
7.3.160.0180.00516.27
7.3.150.0160.00616.19
7.3.140.0140.00216.19
7.3.130.0090.01016.15
7.3.120.0120.00515.63
7.3.110.0090.00615.43
7.3.100.0090.00615.51
7.3.90.0140.00315.58
7.3.80.0120.00415.62
7.3.70.0070.00715.65
7.3.60.0100.00615.50
7.3.50.0170.00115.63
7.3.40.0160.00015.68
7.3.30.0120.00715.75
7.3.20.0150.00217.53
7.3.10.0120.00317.50
7.3.00.0150.00317.57
7.2.340.0180.00316.56
7.2.330.0140.00816.63
7.2.320.0140.00516.43
7.2.310.0150.00416.57
7.2.300.0160.00716.56
7.2.290.0140.00616.42
7.2.280.0130.00916.30
7.2.270.0180.00416.30
7.2.260.0220.00016.56
7.2.250.0210.00316.39
7.2.240.0160.00515.81
7.2.230.0130.00515.92
7.2.220.0100.00815.84
7.2.210.0160.00415.76
7.2.200.0110.01015.65
7.2.190.0110.00915.84
7.2.180.0120.00615.77
7.2.170.0150.00515.84
7.2.160.0110.00815.76
7.2.150.0140.00517.63
7.2.140.0140.00517.65
7.2.130.0130.00417.84
7.2.120.0130.00617.63
7.2.110.0110.00917.82
7.2.100.0100.00817.68
7.2.90.0160.00417.75
7.2.80.0260.01016.58
7.2.70.0250.01016.80
7.2.60.0190.00816.78
7.2.50.0240.00916.69
7.2.40.0530.00617.07
7.2.30.0440.01017.21
7.2.20.0460.00917.00
7.2.10.0680.00817.12
7.2.00.0600.00917.18
7.1.330.0090.00616.59
7.1.320.0090.00716.66
7.1.310.0120.00616.60
7.1.300.0100.00616.53
7.1.290.0070.00716.61
7.1.280.0110.00516.66
7.1.270.0090.00616.66
7.1.260.0110.00516.64
7.1.250.0070.00516.43
7.1.240.0100.00717.15
7.1.230.0170.00017.44
7.1.220.0150.00317.38
7.1.210.0150.00317.23
7.1.200.0260.00515.49
7.1.190.0400.00015.58
7.1.180.0360.00515.58
7.1.170.0290.00915.48
7.1.160.0680.00716.01
7.1.150.0660.00815.91
7.1.140.0690.00915.96
7.1.130.0630.00515.97
7.1.120.0640.00516.04
7.1.110.0630.00215.70
7.1.100.0410.00915.60
7.1.90.0560.00615.76
7.1.80.0460.01115.86
7.1.70.0380.00615.87
7.1.60.0480.00624.87
7.1.50.0560.00724.72
7.1.40.0510.00824.47
7.1.30.0460.01024.57
7.1.20.0500.00924.45
7.1.10.0290.00615.59
7.1.00.0390.00815.57
7.0.330.0130.00416.84
7.0.320.0190.00016.93
7.0.310.0300.00615.17
7.0.300.0340.00315.30
7.0.290.0670.00215.57
7.0.280.0290.00415.23
7.0.270.0620.00715.74
7.0.260.0560.00715.67
7.0.250.0690.00415.36
7.0.240.0590.00615.44
7.0.230.0540.01115.34
7.0.220.0720.01015.27
7.0.210.0470.00815.04
7.0.200.0390.00615.68
7.0.190.0460.00715.47
7.0.180.0470.00615.34
7.0.170.0440.00815.43
7.0.160.0300.00715.31
7.0.150.0270.00815.35
7.0.140.0380.00915.29
7.0.130.0700.00615.47
7.0.120.0430.00515.48
7.0.110.0280.00815.33
7.0.100.0440.01015.33
7.0.90.0380.00715.38
7.0.80.0280.00815.37
7.0.70.0360.00415.38
7.0.60.0240.00715.24
7.0.50.0240.00615.37
7.0.40.0320.00715.15
7.0.30.0360.00515.16
7.0.20.0330.00515.13
7.0.10.0470.00515.08
7.0.00.0450.00615.12
5.6.400.0170.00015.80
5.6.390.0180.00015.83
5.6.380.0130.00416.09
5.6.370.0130.00315.98
5.6.360.0150.00216.01
5.6.350.0110.00615.84
5.6.340.0210.00016.06
5.6.330.0130.00416.04
5.6.320.0160.00016.02
5.6.310.0100.00715.99
5.6.300.0120.02817.83
5.6.290.0080.03718.00
5.6.280.0120.02917.90
5.6.270.0100.02918.02
5.6.260.0140.02618.06
5.6.250.0090.03017.96
5.6.240.0110.03918.01
5.6.230.0110.03118.05
5.6.220.0150.02718.04
5.6.210.0120.03117.94
5.6.200.0120.03218.09
5.6.190.0110.03018.06
5.6.180.0110.02817.95
5.6.170.0130.02517.98
5.6.160.0110.02818.04
5.6.150.0130.02818.17
5.6.140.0100.03018.00
5.6.130.0110.03718.02
5.6.120.0130.02718.01
5.6.110.0100.02817.95
5.6.100.0110.03018.01
5.6.90.0130.02817.91
5.6.80.0170.02717.62
5.6.70.0090.03017.70
5.6.60.0080.02717.60
5.6.50.0080.02717.60
5.6.40.0090.02917.63
5.6.30.0120.02517.65
5.6.20.0110.02717.70
5.6.10.0100.02817.57
5.6.00.0120.02617.66

preferences:
158.35 ms | 403 KiB | 5 Q