3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! function iterator_compose() { foreach (array_reverse(func_get_args()) as $it) { if (is_callable($it)) { $prev = $it; } } } function iterator_chunk(\Traversable $it, $chunkSize) { $it = new \IteratorIterator($it); $chunk = []; $steps = range(0, $chunkSize); while (true) { foreach ($steps as $_) { $chunk[] = $it->current(); $it->next(); if (!$it->valid()) { break 1; } } yield $chunk; $chunk = []; } if ($chunk) { yield $chunk; } } $it = new ArrayIterator(range(0, 125)); foreach (iterator_chunk($it, 32) as $i => $c) { echo "====== Chunk $i ======\n"; var_export($c); 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.0170.00718.14
8.3.50.0240.01116.39
8.3.40.0070.01418.97
8.3.30.0400.01318.77
8.3.20.0100.00018.77
8.3.10.0320.00420.66
8.3.00.0140.00917.75
8.2.180.0380.01416.88
8.2.170.0170.01022.96
8.2.160.0210.01322.13
8.2.150.0090.00024.18
8.2.140.0050.01424.66
8.2.130.0100.00026.16
8.2.120.0110.00419.95
8.2.110.0350.00020.56
8.2.100.0160.00017.85
8.2.90.0090.00918.34
8.2.80.0080.00817.97
8.2.70.0060.00317.75
8.2.60.0090.00018.05
8.2.50.0000.01018.07
8.2.40.0130.00418.22
8.2.30.0000.01118.18
8.2.20.0050.01417.75
8.2.10.0060.00617.91
8.2.00.0090.00317.91
8.1.280.0130.01325.92
8.1.270.0100.00023.99
8.1.260.0250.01226.35
8.1.250.0060.00628.09
8.1.240.0120.00022.20
8.1.230.0150.00320.97
8.1.220.0000.00817.77
8.1.210.0080.00819.03
8.1.200.0040.00917.23
8.1.190.0050.00517.64
8.1.180.0070.00318.10
8.1.170.0060.01318.84
8.1.160.0090.00018.93
8.1.150.0160.00018.74
8.1.140.0030.00617.46
8.1.130.0070.00717.80
8.1.120.0040.00417.53
8.1.110.0030.00717.55
8.1.100.0000.01717.58
8.1.90.0050.00317.61
8.1.80.0000.01117.50
8.1.70.0090.00017.48
8.1.60.0060.00317.68
8.1.50.0030.00617.46
8.1.40.0000.01217.66
8.1.30.0070.00317.68
8.1.20.0040.00717.62
8.1.10.0060.00617.55
8.1.00.0130.00717.65
8.0.300.0000.00919.82
8.0.290.0060.00316.75
8.0.280.0090.00918.29
8.0.270.0100.00017.25
8.0.260.0000.00716.85
8.0.250.0000.00916.91
8.0.240.0140.00516.89
8.0.230.0000.01016.90
8.0.220.0070.00416.84
8.0.210.0060.00316.96
8.0.200.0040.00416.88
8.0.190.0150.00517.05
8.0.180.0130.00017.00
8.0.170.0100.00316.96
8.0.160.0080.00816.89
8.0.150.0040.00416.82
8.0.140.0040.00816.79
8.0.130.0050.01113.48
8.0.120.0070.00316.95
8.0.110.0070.00416.82
8.0.100.0080.00416.89
8.0.90.0070.00716.98
8.0.80.0240.02416.95
8.0.70.0060.01216.93
8.0.60.0070.00716.85
8.0.50.0110.00016.76
8.0.30.0330.01817.15
8.0.20.0240.03017.24
8.0.10.0030.00616.89
8.0.00.0350.01316.87
7.4.330.0030.00314.78
7.4.320.0070.00716.43
7.4.300.0120.00616.52
7.4.290.0030.00616.54
7.4.280.0080.00416.50
7.4.270.0000.00816.40
7.4.260.0070.00713.26
7.4.250.0070.01416.40
7.4.240.0150.00016.37
7.4.230.0020.00716.39
7.4.220.0190.07316.36
7.4.210.0140.02116.45
7.4.200.0120.00316.44
7.4.190.0000.01616.65
7.4.160.0430.02416.51
7.4.150.0270.01517.07
7.4.140.0250.02817.14
7.4.130.0250.01716.47
7.4.120.0270.01716.52
7.4.110.0520.02216.44
7.4.100.0350.01416.39
7.4.90.0480.02016.49
7.4.80.0410.04118.80
7.4.70.0520.02516.40
7.4.60.0300.04116.57
7.4.50.0230.00916.22
7.4.40.0000.01522.27
7.4.30.0800.03716.46
7.3.330.0060.00313.44
7.3.320.0030.00613.50
7.3.310.0050.00316.23
7.3.300.0110.00516.40
7.3.290.0190.02316.39
7.3.280.0390.02016.29
7.3.270.0350.02217.07
7.3.260.0590.03218.24
7.3.250.0310.02616.29
7.3.240.0240.02816.45
7.3.230.0320.03316.53
7.3.210.0580.01716.27
7.3.200.0680.03419.39
7.3.190.0400.00716.48
7.3.180.0870.01316.32
7.3.170.0300.03616.38
7.3.160.0750.02116.41
7.2.330.0460.04016.75
7.2.320.0410.02416.83
7.2.310.0400.03916.75
7.2.300.0850.03216.49
7.2.290.0700.03016.79
7.2.110.0100.01716.00
7.2.100.0120.00616.27
7.2.90.0110.00616.45
7.2.80.0170.01016.34
7.2.70.0160.00616.26
7.2.60.0110.00716.70
7.2.50.0100.01016.78
7.2.40.0120.00316.47
7.2.30.0130.00316.45
7.2.20.0170.00316.79
7.2.10.0170.00016.56
7.2.00.0230.01116.68
7.1.230.0100.00615.76
7.1.220.0140.00715.74
7.1.210.0090.00615.62
7.1.200.0120.00415.54
7.1.190.0030.01515.61
7.1.180.0070.01015.59
7.1.170.0200.00015.71
7.1.160.0150.00315.57
7.1.150.0210.00315.50
7.1.140.0110.00715.68
7.1.130.0000.01315.89
7.1.120.0130.00715.76
7.1.110.0120.00315.52
7.1.100.0090.00615.74
7.1.90.0070.01515.39
7.1.80.0160.00315.55
7.1.70.0130.00916.37
7.1.60.0200.01117.72
7.1.50.0190.01016.49
7.1.40.0140.00715.85
7.1.30.0180.00715.86
7.1.20.0190.00916.05
7.1.10.0030.01415.53
7.1.00.0110.04418.84
7.0.310.0150.00915.00
7.0.300.0130.00515.49
7.0.290.0070.00715.37
7.0.280.0170.01015.36
7.0.270.0140.00315.28
7.0.260.0090.01315.40
7.0.250.0100.01015.37
7.0.240.0090.00915.36
7.0.230.0150.00914.89
7.0.220.0120.00815.05
7.0.210.0080.00615.17
7.0.200.0080.00916.14
7.0.190.0160.00415.30
7.0.180.0160.00315.40
7.0.170.0160.00415.50
7.0.160.0130.00015.29
7.0.150.0200.00715.20
7.0.140.0160.04018.62
7.0.130.0120.00615.37
7.0.120.0130.00315.25
7.0.110.0270.00315.16
7.0.100.0100.04217.62
7.0.90.0130.04317.52
7.0.80.0110.03017.48
7.0.70.0070.05017.63
7.0.60.0130.04517.63
7.0.50.0150.02017.78
7.0.40.0130.04516.62
7.0.30.0150.02316.77
7.0.20.0110.04616.69
7.0.10.0050.04116.77
7.0.00.0140.03816.85
5.6.380.0210.00014.19
5.6.370.0150.00514.47
5.6.360.0070.00714.34
5.6.350.0130.00314.68
5.6.340.0060.01014.45
5.6.330.0110.01114.35
5.6.320.0130.00014.16
5.6.310.0040.01214.68
5.6.300.0120.00314.45
5.6.290.0100.01014.73
5.6.280.0120.03717.66
5.6.270.0090.00614.31
5.6.260.0060.00914.30
5.6.250.0060.04617.47
5.6.240.0190.04217.52
5.6.230.0140.04017.40
5.6.220.0050.02817.54
5.6.210.0140.02717.44
5.6.200.0110.03317.80
5.6.190.0170.03017.56
5.6.180.0070.02517.86
5.6.170.0050.05117.86
5.6.160.0120.04217.80
5.6.150.0110.03317.74
5.6.140.0140.04517.90
5.6.130.0130.04417.82
5.6.120.0030.02917.88
5.6.110.0140.04617.69
5.6.100.0090.04317.77
5.6.90.0120.03717.79
5.6.80.0150.04617.44
5.6.70.0080.04817.39
5.6.60.0120.03717.32
5.6.50.0140.03917.43
5.6.40.0090.04217.36
5.6.30.0130.04617.38
5.6.20.0100.04817.28
5.6.10.0120.02617.52
5.6.00.0100.04017.39
5.5.380.0130.04115.82
5.5.370.0120.04015.94
5.5.360.0170.04015.96
5.5.350.0050.05715.89
5.5.340.0100.04416.08
5.5.330.0140.03416.07
5.5.320.0090.03216.04
5.5.310.0150.03616.02
5.5.300.0150.04216.04
5.5.290.0100.03916.05
5.5.280.0100.02315.93
5.5.270.0120.05016.13
5.5.260.0110.04916.07
5.5.250.0090.03216.03
5.5.240.0100.03515.87
5.5.230.0130.04315.76
5.5.220.0100.03515.74
5.5.210.0130.03515.77
5.5.200.0090.02715.88
5.5.190.0080.03715.57
5.5.180.0100.03815.60
5.5.170.0110.00613.81
5.5.160.0150.02215.69
5.5.150.0130.04315.85
5.5.140.0080.03315.71
5.5.130.0110.04015.64
5.5.120.0080.03215.64
5.5.110.0120.02515.66
5.5.100.0100.02915.46
5.5.90.0080.03015.58
5.5.80.0090.02815.62
5.5.70.0080.02215.43
5.5.60.0130.02715.67
5.5.50.0220.01915.75
5.5.40.0100.02115.73
5.5.30.0100.03115.68
5.5.20.0100.02015.74
5.5.10.0180.02315.58
5.5.00.0090.02215.53
5.4.450.0040.04315.16
5.4.440.0060.03615.08
5.4.430.0060.04615.01
5.4.420.0120.03815.16
5.4.410.0020.04715.08
5.4.400.0040.03114.89
5.4.390.0060.03514.93
5.4.380.0050.04414.68
5.4.370.0070.04014.74
5.4.360.0030.04014.98
5.4.350.0070.03714.80
5.4.340.0080.03914.81
5.4.330.0050.00310.75
5.4.320.0030.03514.86
5.4.310.0050.04014.89
5.4.300.0070.03814.74
5.4.290.0020.02914.83
5.4.280.0090.03514.80
5.4.270.0080.02314.77
5.4.260.0060.02214.73
5.4.250.0020.03114.71
5.4.240.0030.02514.72
5.4.230.0050.02314.77
5.4.220.0050.02314.91
5.4.210.0060.02414.94
5.4.200.0060.02114.83
5.4.190.0040.02614.76
5.4.180.0070.02214.91
5.4.170.0050.02315.04
5.4.160.0080.02214.78
5.4.150.0050.02614.90
5.4.140.0070.02113.71
5.4.130.0060.01913.73
5.4.120.0070.02313.79
5.4.110.0090.01913.75
5.4.100.0100.01613.86
5.4.90.0060.02213.79
5.4.80.0050.02313.72
5.4.70.0090.01913.55
5.4.60.0050.02213.66
5.4.50.0090.02613.69
5.4.40.0080.01913.53
5.4.30.0080.01913.40
5.4.20.0060.02313.61
5.4.10.0080.02113.57
5.4.00.0070.01813.19
5.3.290.0050.03512.93
5.3.280.0030.02213.00
5.3.270.0040.02113.07
5.3.260.0060.03113.04
5.3.250.0090.02013.02
5.3.240.0050.02512.96
5.3.230.0050.03912.96
5.3.220.0070.02812.83
5.3.210.0060.02513.00
5.3.200.0070.02312.86
5.3.190.0060.02112.90
5.3.180.0050.02013.07
5.3.170.0110.01713.06
5.3.160.0110.01713.08
5.3.150.0100.01713.06
5.3.140.0070.02012.96
5.3.130.0090.02013.04
5.3.120.0020.02512.93
5.3.110.0080.02012.93
5.3.100.0060.02213.03
5.3.90.0050.02313.08
5.3.80.0060.02412.90
5.3.70.0100.01713.08
5.3.60.0040.02413.02
5.3.50.0090.01912.90
5.3.40.0070.01812.84
5.3.30.0080.01713.00
5.3.20.0070.01512.84
5.3.10.0110.01212.83
5.3.00.0050.02112.91
5.2.170.0050.01612.42
5.2.160.0070.01712.56
5.2.150.0040.02112.56
5.2.140.0110.01312.57
5.2.130.0030.01612.50
5.2.120.0020.01512.54
5.2.110.0080.01512.41
5.2.100.0080.01112.51
5.2.90.0040.01712.53
5.2.80.0100.01212.34
5.2.70.0050.01512.52
5.2.60.0040.01512.31
5.2.50.0040.01312.35
5.2.40.0040.01412.50
5.2.30.0070.01312.49
5.2.20.0040.01612.44
5.2.10.0050.03512.23
5.2.00.0050.01512.32
5.1.60.0060.01312.23
5.1.50.0030.01212.23
5.1.40.0040.02712.23
5.1.30.0100.01712.23
5.1.20.0060.02312.23
5.1.10.0040.03012.23
5.1.00.0030.02812.23
5.0.50.0040.02212.23
5.0.40.0050.00812.23
5.0.30.0040.02612.23
5.0.20.0040.02012.23
5.0.10.0020.01412.23
5.0.00.0020.02012.23
4.4.90.0040.00912.23
4.4.80.0030.00712.23
4.4.70.0020.01012.23
4.4.60.0060.01012.23
4.4.50.0000.01812.23
4.4.40.0030.01412.23
4.4.30.0040.01912.23
4.4.20.0040.00912.23
4.4.10.0070.01712.23
4.4.00.0030.02812.23
4.3.110.0030.01612.23
4.3.100.0060.01512.23
4.3.90.0050.01612.23
4.3.80.0020.02412.23
4.3.70.0030.00812.23
4.3.60.0050.00712.23
4.3.50.0030.01312.23
4.3.40.0080.00812.23
4.3.30.0020.02012.23
4.3.20.0050.00712.23
4.3.10.0020.01712.23
4.3.00.0030.01512.23

preferences:
42.37 ms | 401 KiB | 5 Q