3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Pinq\Iterators\Standard; /** * Common functionality for the array iterator * * @author Elliot Levin <elliotlevin@hotmail.com> */ trait ArrayIterator { /** * @var array */ protected $array; public function __constructIterator(array &$array) { $this->array =& $array; } /** * @return array */ final public function getArrayCopy() { return $this->array; } } /** * Implementation of the array iterator using the fetch method. * * @author Elliot Levin <elliotlevin@hotmail.com> */ class ArrayIterator { use ArrayIterator; public function __construct(array $array) { self::__constructIterator($array); } public function doRewind() { reset($this->array); } final protected function doFetch() { $key = key($this->array); if ($key === null) { return null; } next($this->array); return [$key, &$this->array[$key]]; } } (new ArrayIterator([]));

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.01318.41
8.3.50.0050.01221.94
8.3.40.0140.00318.72
8.3.30.0170.00318.96
8.3.20.0040.00420.29
8.3.10.0070.00021.90
8.3.00.0030.00720.95
8.2.180.0110.00416.75
8.2.170.0080.00822.96
8.2.160.0100.00322.09
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0030.00619.83
8.2.110.0060.00322.29
8.2.100.0090.00317.63
8.2.90.0000.00719.17
8.2.80.0000.00917.97
8.2.70.0000.01017.50
8.2.60.0040.00417.93
8.2.50.0030.00518.07
8.2.40.0000.00818.09
8.2.30.0050.00218.03
8.2.20.0050.00317.67
8.2.10.0000.00817.98
8.2.00.0040.00417.74
8.1.280.0070.01125.92
8.1.270.0050.00320.54
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00723.92
8.1.230.0030.00919.01
8.1.220.0000.00917.74
8.1.210.0040.00418.77
8.1.200.0070.00317.35
8.1.190.0080.00017.23
8.1.180.0000.00718.10
8.1.170.0050.00320.22
8.1.160.0050.00221.98
8.1.150.0000.00718.84
8.1.140.0040.00419.13
8.1.130.0030.00517.77
8.1.120.0030.00417.45
8.1.110.0000.00717.40
8.1.100.0000.00717.30
8.1.90.0000.00717.30
8.1.80.0040.00417.30
8.1.70.0070.00017.36
8.1.60.0000.00917.43
8.1.50.0040.00417.37
8.1.40.0000.00817.34
8.1.30.0000.00817.57
8.1.20.0040.00417.43
8.1.10.0000.00817.24
8.1.00.0080.00417.29
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00718.40
8.0.270.0030.00317.20
8.0.260.0000.00817.15
8.0.250.0030.00316.92
8.0.240.0030.00316.94
8.0.230.0030.00316.94
8.0.220.0000.00716.76
8.0.210.0040.00416.75
8.0.200.0030.00616.97
8.0.190.0000.00716.94
8.0.180.0040.00416.88
8.0.170.0000.00816.93
8.0.160.0080.00016.90
8.0.150.0000.00716.86
8.0.140.0070.00016.77
8.0.130.0060.00013.32
8.0.120.0080.00016.91
8.0.110.0050.00216.93
8.0.100.0040.00416.87
8.0.90.0040.00316.74
8.0.80.0090.00616.90
8.0.70.0030.00516.95
8.0.60.0040.00416.77
8.0.50.0000.00716.76
8.0.30.0080.01517.00
8.0.20.0140.00917.40
8.0.10.0050.00216.84
8.0.00.0090.01216.69
7.4.330.0050.00015.03
7.4.320.0030.00316.54
7.4.300.0030.00316.44
7.4.290.0000.00716.34
7.4.280.0030.00316.45
7.4.270.0040.00416.30
7.4.260.0070.00016.36
7.4.250.0070.00316.41
7.4.240.0040.00416.54
7.4.230.0040.00416.59
7.4.220.0040.01416.49
7.4.210.0080.00816.50
7.4.200.0040.00416.61
7.4.160.0040.01416.51
7.4.150.0090.01017.40
7.4.140.0100.00717.86
7.4.130.0050.01316.75
7.4.120.0080.00816.49
7.4.110.0100.01016.38
7.4.100.0130.00616.57
7.4.90.0120.00616.54
7.4.80.0120.00916.47
7.4.70.0090.00916.55
7.4.60.0040.01216.53
7.4.50.0040.00416.47
7.4.40.0100.00716.36
7.4.30.0000.01716.44
7.4.00.0110.00414.71
7.3.330.0030.00313.20
7.3.320.0060.00613.27
7.3.310.0000.00716.25
7.3.300.0040.00416.13
7.3.290.0060.00016.14
7.3.280.0090.00916.24
7.3.270.0150.00617.40
7.3.260.0170.00016.61
7.3.250.0130.00816.36
7.3.240.0150.00616.53
7.3.230.0070.01116.39
7.3.210.0110.00716.30
7.3.200.0030.01519.39
7.3.190.0040.01716.30
7.3.180.0090.00916.29
7.3.170.0090.00916.33
7.3.160.0060.01316.46
7.2.330.0070.01016.66
7.2.320.0170.00016.59
7.2.310.0130.00916.39
7.2.300.0130.00316.66
7.2.290.0100.00716.58
7.2.60.0100.00316.61
7.2.00.0090.00519.09
7.1.200.0070.00715.69
7.1.100.0060.00918.16
7.1.70.0030.00516.94
7.1.60.0030.02219.46
7.1.50.0060.00616.84
7.1.00.0030.07722.30
7.0.200.0140.00714.60
7.0.140.0070.06021.92
7.0.60.0270.03720.03
7.0.50.0070.05017.87
7.0.40.0100.08020.24
7.0.30.0330.07320.24
7.0.20.0270.03320.06
7.0.10.0000.05020.33
7.0.00.0200.04020.07
5.6.280.0000.07320.83
5.6.210.0130.07720.61
5.6.200.0130.08018.18
5.6.190.0030.05020.52
5.6.180.4230.04020.48
5.6.170.0200.04320.54
5.6.160.0070.08720.54
5.6.150.0100.07018.23
5.6.140.0000.08718.29
5.6.130.0030.08018.17
5.6.120.0100.07721.01
5.6.110.0030.09021.00
5.6.100.0100.07021.11
5.6.90.0000.07020.96
5.6.80.0170.04020.36
5.5.350.2870.03320.39
5.5.340.0030.06318.08
5.5.330.0100.08020.57
5.5.320.0200.04720.35
5.5.310.0230.07020.30
5.5.300.0070.08318.08
5.5.290.0030.08318.08
5.5.280.0070.05020.81
5.5.270.0000.04720.80
5.5.260.0130.06720.66
5.5.250.0070.08720.60
5.5.240.0200.06320.25
5.4.450.0600.06019.48
5.4.440.1070.06319.16
5.4.430.0100.05319.44
5.4.420.0900.05319.55
5.4.410.0200.05319.57
5.4.400.0870.05718.84
5.4.390.0200.05718.47
5.4.380.0200.05318.46
5.4.370.0170.05718.78
5.4.360.0230.04718.63
5.4.350.0270.05318.80
5.4.340.0330.04318.73
5.4.320.0200.06018.57
5.4.310.0270.04718.71
5.4.300.0200.05318.52
5.4.290.0270.04318.73
5.4.280.0230.04718.62
5.4.270.0230.05318.79
5.4.260.0170.06018.77
5.4.250.0230.06318.50
5.4.240.0200.05318.57
5.4.230.0170.05018.46
5.4.220.0200.05318.59
5.4.210.0330.06018.73
5.4.200.0230.04716.80
5.4.190.0230.04718.45
5.4.180.0200.05318.45
5.4.170.0370.05718.82
5.4.160.0270.04318.61
5.4.150.0230.07018.72
5.4.140.0100.06316.34
5.4.130.0200.05016.28
5.4.120.0300.04316.45
5.4.110.0330.06016.29
5.4.100.0200.07016.22
5.4.90.0270.07016.29
5.4.80.0330.05716.19
5.4.70.0400.04016.26
5.4.60.0170.05716.39
5.4.50.0300.04316.17
5.4.40.0270.05716.29
5.4.30.0300.04016.23
5.4.20.0230.04716.16
5.4.10.0100.05716.24
5.4.00.0200.04315.75
5.3.290.0200.05314.66
5.3.280.0200.05714.49
5.3.270.0130.06014.68
5.3.260.0170.05714.60
5.3.250.0130.05714.60
5.3.240.0070.06714.59
5.3.230.0200.05014.58
5.3.220.0130.05714.62
5.3.210.0170.06014.52
5.3.200.0130.05714.56
5.3.190.0100.05714.66
5.3.180.0230.04314.45
5.3.170.0200.04714.63
5.3.160.0200.04714.50
5.3.150.0300.04714.49
5.3.140.0200.05314.55
5.3.130.0130.06314.54
5.3.120.0270.04714.50
5.3.110.0170.06714.64
5.3.100.0100.05714.04
5.3.90.0270.04314.02
5.3.80.0200.05313.94
5.3.70.0100.05713.95
5.3.60.0230.04713.94
5.3.50.0200.04713.89
5.3.40.0230.04313.87
5.3.30.0270.04014.00
5.3.20.0230.04013.77
5.3.10.0200.04313.59
5.3.00.0100.05713.59
5.2.170.0100.04311.11
5.2.160.0130.04011.10
5.2.150.0130.05311.10
5.2.140.0100.06011.19
5.2.130.0130.04011.08
5.2.120.0130.04711.16
5.2.110.0100.04711.16
5.2.100.0200.03711.03
5.2.90.0070.05311.03
5.2.80.0130.04711.07
5.2.70.0070.05011.14
5.2.60.0230.03311.00
5.2.50.0170.03710.94
5.2.40.0100.04011.00
5.2.30.0070.04711.12
5.2.20.0130.04311.01
5.2.10.0170.03310.99
5.2.00.0130.03710.81
5.1.60.0070.0409.95
5.1.50.0070.04010.13
5.1.40.0130.03310.02
5.1.30.0130.03310.33
5.1.20.0100.04310.42
5.1.10.0200.03310.08
5.1.00.0170.03010.12
5.0.50.0070.0308.57
5.0.40.0070.0308.46
5.0.30.0130.0478.24
5.0.20.0070.0338.37
5.0.10.0030.0438.18
5.0.00.0070.0538.33
4.4.90.0100.0275.83
4.4.80.0030.0335.91
4.4.70.0070.0305.87
4.4.60.0070.0305.89
4.4.50.0070.0305.90
4.4.40.0030.0475.81
4.4.30.0030.0335.91
4.4.20.0030.0235.95
4.4.10.0070.0235.94
4.4.00.0030.0375.92
4.3.110.0030.0275.76
4.3.100.0100.0205.79
4.3.90.0100.0235.92
4.3.80.0200.0275.88
4.3.70.0100.0205.82
4.3.60.0070.0235.84
4.3.50.0100.0275.81
4.3.40.0100.0275.78
4.3.30.0030.0234.88
4.3.20.0070.0234.88
4.3.10.0100.0174.88
4.3.00.0300.01714.42

preferences:
45 ms | 401 KiB | 5 Q