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 ArrayIteratorT { /** * @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 ArrayIteratorT; 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.01016.50
8.3.50.0070.01122.05
8.3.40.0110.00418.67
8.3.30.0110.00719.08
8.3.20.0080.00020.34
8.3.10.0000.00821.73
8.3.00.0070.00320.84
8.2.180.0120.00316.38
8.2.170.0130.00322.96
8.2.160.0100.00322.11
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0090.00018.03
8.2.110.0060.00322.11
8.2.100.0060.00617.50
8.2.90.0000.00719.13
8.2.80.0000.00817.97
8.2.70.0040.01117.25
8.2.60.0040.00417.78
8.2.50.0040.00418.07
8.2.40.0000.00818.22
8.2.30.0000.00718.06
8.2.20.0060.00317.69
8.2.10.0050.00318.07
8.2.00.0040.00417.74
8.1.280.0090.00625.92
8.1.270.0040.00420.79
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0040.00423.82
8.1.230.0080.00419.13
8.1.220.0000.00917.74
8.1.210.0030.00618.77
8.1.200.0060.00317.25
8.1.190.0090.00017.13
8.1.180.0000.00718.10
8.1.170.0080.00020.25
8.1.160.0000.00721.94
8.1.150.0040.00418.83
8.1.140.0000.00819.04
8.1.130.0030.00517.77
8.1.120.0030.00317.38
8.1.110.0000.00717.37
8.1.100.0050.00217.39
8.1.90.0070.00017.38
8.1.80.0030.00317.45
8.1.70.0000.00717.30
8.1.60.0000.00817.53
8.1.50.0030.00617.49
8.1.40.0000.00817.46
8.1.30.0040.00417.48
8.1.20.0040.00417.59
8.1.10.0040.00417.49
8.1.00.0070.00717.51
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0040.00418.38
8.0.270.0030.00317.17
8.0.260.0000.00817.27
8.0.250.0030.00317.04
8.0.240.0070.00017.00
8.0.230.0040.00416.99
8.0.220.0080.00016.87
8.0.210.0040.00416.92
8.0.200.0090.00017.02
8.0.190.0030.00516.94
8.0.180.0000.00716.98
8.0.170.0040.00416.87
8.0.160.0000.00816.93
8.0.150.0030.00316.79
8.0.140.0070.00016.88
8.0.130.0030.00313.32
8.0.120.0040.00416.88
8.0.110.0000.00716.92
8.0.100.0000.00716.90
8.0.90.0030.00616.73
8.0.80.0110.00416.86
8.0.70.0070.00016.76
8.0.60.0040.00416.93
8.0.50.0040.00416.83
8.0.30.0120.01317.05
8.0.20.0110.01217.40
8.0.10.0040.00416.84
8.0.00.0050.01516.81
7.4.330.0020.00215.08
7.4.320.0030.00316.63
7.4.300.0000.00616.57
7.4.290.0070.00016.55
7.4.280.0040.00416.54
7.4.270.0030.00316.49
7.4.260.0080.00016.53
7.4.250.0050.00316.57
7.4.240.0040.00316.39
7.4.230.0000.00716.50
7.4.220.0070.01016.54
7.4.210.0080.00916.42
7.4.200.0030.00516.57
7.4.160.0120.00316.53
7.4.150.0170.00717.40
7.4.140.0100.00817.86
7.4.130.0140.00416.46
7.4.120.0130.00316.41
7.4.110.0070.01816.36
7.4.100.0100.01116.35
7.4.90.0040.01416.36
7.4.80.0060.01116.49
7.4.70.0030.01316.51
7.4.60.0060.00916.38
7.4.50.0040.00416.32
7.4.40.0160.00016.35
7.4.30.0170.00716.64
7.4.10.0030.01415.13
7.4.00.0040.00914.98
7.3.330.0050.00013.08
7.3.320.0130.00013.27
7.3.310.0000.00716.25
7.3.300.0030.00316.12
7.3.290.0030.00316.18
7.3.280.0110.00916.25
7.3.270.0130.00617.40
7.3.260.0130.00316.18
7.3.250.0120.00816.38
7.3.240.0110.00616.45
7.3.230.0130.00716.50
7.3.210.0130.00316.34
7.3.200.0060.01219.39
7.3.190.0140.00316.34
7.3.180.0060.01016.21
7.3.170.0080.01116.27
7.3.160.0090.00916.37
7.3.130.0150.00414.60
7.3.120.0130.00314.81
7.3.110.0030.01614.58
7.3.100.0050.00914.76
7.3.90.0060.00614.74
7.3.80.0000.00914.73
7.3.70.0070.00714.56
7.3.60.0030.00714.66
7.3.50.0000.01214.63
7.3.40.0030.00914.79
7.3.30.0070.00414.69
7.3.20.0030.01216.64
7.3.10.0100.00416.50
7.3.00.0130.00216.37
7.2.330.0060.01216.52
7.2.320.0030.01216.43
7.2.310.0070.01116.66
7.2.300.0130.00316.65
7.2.290.0100.00716.73
7.2.260.0060.01214.88
7.2.250.0060.01215.20
7.2.240.0100.00714.92
7.2.230.0030.01014.84
7.2.220.0040.00814.93
7.2.210.0080.00314.57
7.2.200.0070.01014.84
7.2.190.0000.01414.88
7.2.180.0060.00914.75
7.2.170.0000.01314.88
7.2.160.0060.00915.07
7.2.150.0000.01616.87
7.2.140.0030.00616.95
7.2.130.0070.01016.65
7.2.120.0110.00516.95
7.2.110.0080.01016.60
7.2.100.0060.00416.83
7.2.90.0070.00916.94
7.2.80.0060.01016.80
7.2.70.0070.00716.71
7.2.60.0070.00716.81
7.2.50.0040.01016.66
7.2.40.0070.00516.75
7.2.30.0050.00916.77
7.2.20.0070.00616.82
7.2.10.0060.00616.73
7.2.00.0060.01017.71
7.1.330.0040.01115.67
7.1.320.0070.01015.77
7.1.310.0100.00315.71
7.1.300.0030.00615.64
7.1.290.0040.00415.48
7.1.280.0040.00415.61
7.1.270.0060.00315.44
7.1.260.0060.00315.77
7.1.250.0040.00815.83
7.1.240.0090.00615.74
7.1.230.0070.00415.56
7.1.220.0030.01015.68
7.1.210.0030.00815.80
7.1.200.0100.00315.54
7.1.190.0040.01115.84
7.1.180.0060.00315.74
7.1.170.0030.01015.55
7.1.160.0060.00315.87
7.1.150.0100.00315.51
7.1.140.0090.00615.80
7.1.130.0030.00815.75
7.1.120.0060.00615.61
7.1.110.0060.00615.58
7.1.100.0110.00715.84
7.1.90.0060.00615.54
7.1.80.0030.01015.58
7.1.70.0050.00416.42
7.1.60.0080.01017.65
7.1.50.0100.00816.05
7.1.40.0100.00315.73
7.1.30.0060.01015.83
7.1.20.0060.00615.71
7.1.10.0030.00915.77
7.1.00.0050.04319.05
7.0.330.0040.01415.26
7.0.320.0030.00915.47
7.0.310.0030.00515.45
7.0.300.0000.01515.29
7.0.290.0060.00915.26
7.0.280.0070.00415.40
7.0.270.0120.00015.09
7.0.260.0050.00315.42
7.0.250.0080.00315.43
7.0.240.0110.00415.28
7.0.230.0040.00715.23
7.0.220.0040.00415.25
7.0.210.0030.00615.32
7.0.200.0090.01015.09
7.0.190.0040.00715.31
7.0.180.0080.00315.43
7.0.170.0070.00715.38
7.0.160.0040.01115.13
7.0.150.0000.01215.34
7.0.140.0030.04018.72
7.0.130.0060.00615.35
7.0.120.0130.00315.47
7.0.110.0080.00615.14
7.0.100.0100.00315.02
7.0.90.0060.00315.34
7.0.80.0030.01015.44
7.0.70.0030.00815.34
7.0.60.0120.03917.54
7.0.50.0070.03316.71
7.0.40.0060.03816.72
7.0.30.0190.03316.84
7.0.20.0080.03116.80
7.0.10.0100.04516.88
7.0.00.0100.04216.71
5.6.400.0040.00814.40
5.6.390.0050.00714.34
5.6.380.0000.01114.51
5.6.370.0060.00614.39
5.6.360.0030.00814.22
5.6.350.0080.00414.16
5.6.340.0060.00914.18
5.6.330.0040.00414.30
5.6.320.0090.00614.38
5.6.310.0030.01014.32
5.6.300.0070.00714.38
5.6.290.0030.00714.55
5.6.280.0050.03817.69
5.6.270.0110.00414.42
5.6.260.0000.01414.46
5.6.250.0070.00414.21
5.6.240.0080.00414.16
5.6.230.0070.01014.16
5.6.220.0080.00014.01
5.6.210.0080.03017.50
5.6.200.0070.03516.26
5.6.190.0060.04117.57
5.6.180.1850.02817.30
5.6.170.0080.04417.17
5.6.160.0080.04617.29
5.6.150.0120.03716.27
5.6.140.0070.04516.21
5.6.130.0060.04316.14
5.6.120.0050.04517.71
5.6.110.0140.03717.62
5.6.100.0050.02617.53
5.6.90.0060.04317.59
5.6.80.0050.04817.31
5.6.70.2230.02517.14
5.6.60.0040.01214.11
5.6.50.0000.01714.05
5.6.40.0040.01114.21
5.6.30.0100.00314.03
5.6.20.0030.01014.12
5.6.10.0070.00713.89
5.6.00.0040.00714.16
5.5.380.0080.00414.09
5.5.370.0070.00414.43
5.5.360.0060.01214.10
5.5.350.0180.03517.27
5.5.340.0050.04016.07
5.5.330.0120.03917.24
5.5.320.0150.04217.38
5.5.310.0120.02717.15
5.5.300.0060.02715.94
5.5.290.0050.04416.03
5.5.280.0030.02817.54
5.5.270.0100.03817.61
5.5.260.0070.04517.51
5.5.250.0020.03717.36
5.5.240.0150.04117.17
5.5.230.0030.01213.93
5.5.220.0110.00314.08
5.5.210.0120.00414.31
5.5.200.0040.01113.93
5.5.190.0080.00414.19
5.5.180.0120.00314.17
5.5.170.0140.00014.21
5.5.160.0060.00914.23
5.5.150.0000.00814.13
5.5.140.0070.00714.01
5.5.130.0110.00714.21
5.5.120.0030.01313.74
5.5.110.0060.00914.14
5.5.100.0030.01214.34
5.5.90.0030.00913.86
5.5.80.0040.01113.92
5.5.70.0000.01414.10
5.5.60.0110.00414.07
5.5.50.0070.01014.18
5.5.40.0160.00014.19
5.5.30.0040.00814.09
5.5.20.0070.00714.02
5.5.10.0060.00614.07
5.5.00.0110.00414.25
5.4.450.0260.03015.31
5.4.440.0520.03415.17
5.4.430.0530.03115.22
5.4.420.0530.02515.15
5.4.410.0350.03214.94
5.4.400.0380.03214.94
5.4.390.0100.03214.89
5.4.380.0120.04614.87
5.4.370.0120.04014.73
5.4.360.0030.03814.88
5.4.350.0150.02814.80
5.4.340.0150.02814.71
5.4.330.0000.01211.11
5.4.320.0120.02814.80
5.4.310.0100.02915.00
5.4.300.0080.03214.84
5.4.290.0130.02814.78
5.4.280.0160.02714.61
5.4.270.0080.03014.90
5.4.260.0130.02514.76
5.4.250.0150.02714.77
5.4.240.0110.04114.59
5.4.230.0100.04014.60
5.4.220.0150.02714.84
5.4.210.0140.02814.74
5.4.200.0150.02313.79
5.4.190.0050.03214.63
5.4.180.0130.03114.88
5.4.170.0160.04014.75
5.4.160.0120.02814.74
5.4.150.0140.02914.61
5.4.140.0120.03313.75
5.4.130.0150.02213.81
5.4.120.0160.02513.56
5.4.110.0130.03613.55
5.4.100.0080.03013.55
5.4.90.0120.03913.63
5.4.80.0120.02713.76
5.4.70.0140.03513.57
5.4.60.0170.02713.48
5.4.50.0150.02713.73
5.4.40.0130.03913.63
5.4.30.0080.03213.68
5.4.20.0120.03913.69
5.4.10.0140.02613.69
5.4.00.0140.03013.31
5.3.290.0270.04714.66
5.3.280.0230.05014.52
5.3.270.0300.05314.66
5.3.260.0200.06314.59
5.3.250.0170.06714.59
5.3.240.0370.03714.55
5.3.230.0330.06314.70
5.3.220.0230.07314.65
5.3.210.0400.06014.59
5.3.200.0100.06714.48
5.3.190.0170.07314.66
5.3.180.0230.06714.67
5.3.170.0330.05714.54
5.3.160.0200.07314.47
5.3.150.0130.06014.52
5.3.140.0270.04314.55
5.3.130.0270.05314.64
5.3.120.0070.09314.44
5.3.110.0130.06014.64
5.3.100.0100.08014.07
5.3.90.0230.06713.95
5.3.80.0170.06714.09
5.3.70.0170.05713.96
5.3.60.0270.05713.94
5.3.50.0200.07013.88
5.3.40.0230.06313.89
5.3.30.0230.06713.85
5.3.20.0330.05313.64
5.3.10.0200.06713.73
5.3.00.0200.05013.59
5.2.170.0270.04311.17
5.2.160.0200.05011.28
5.2.150.0170.04711.20
5.2.140.0130.04311.27
5.2.130.0130.04311.06
5.2.120.0270.03711.16
5.2.110.0230.03311.06
5.2.100.0170.04011.07
5.2.90.0130.04311.09
5.2.80.0200.04311.13
5.2.70.0130.05311.14
5.2.60.0200.03711.07
5.2.50.0100.04311.00
5.2.40.0130.04011.14
5.2.30.0170.03710.95
5.2.20.0130.03710.99
5.2.10.0130.03710.90
5.2.00.0100.04010.86
5.1.60.0200.0309.95
5.1.50.0100.03710.00
5.1.40.0130.03310.09
5.1.30.0230.02710.37
5.1.20.0170.04310.35
5.1.10.0200.03010.16
5.1.00.0070.04310.08
5.0.50.0130.0338.64
5.0.40.0130.0338.43
5.0.30.0170.0508.32
5.0.20.0100.0238.26
5.0.10.0100.0308.20
5.0.00.0070.0578.23
4.4.90.0100.0275.90
4.4.80.0130.0275.90
4.4.70.0130.0235.89
4.4.60.0030.0335.83
4.4.50.0100.0275.82
4.4.40.0170.0275.90
4.4.30.0100.0205.88
4.4.20.0100.0275.93
4.4.10.0070.0305.90
4.4.00.0130.0305.98
4.3.110.0070.0235.75
4.3.100.0130.0205.82
4.3.90.0100.0235.89
4.3.80.0070.0335.79
4.3.70.0170.0175.91
4.3.60.0070.0305.80
4.3.50.0100.0235.89
4.3.40.0100.0375.77
4.3.30.0030.0234.88
4.3.20.0030.0274.88
4.3.10.0070.0204.88
4.3.00.0000.01714.42

preferences:
45.9 ms | 401 KiB | 5 Q