3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( array('pear', 'apple'), array('banana', 'coconut'), 'orange' // This is not an array element ); foreach ($array as $value) { // Check type of element... if (is_array($value)) { foreach ($value as $fruit) { echo $fruit . PHP_EOL; } } else { echo $value . PHP_EOL; } } $iterator = new RecursiveArrayIterator($array); foreach(new RecursiveIteratorIterator($iterator) as $value) { echo $value . PHP_EOL; }

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.0110.00716.50
8.3.50.0130.00822.96
8.3.40.0070.00718.60
8.3.30.0110.00319.00
8.3.20.0040.00420.39
8.3.10.0050.00323.48
8.3.00.0040.00417.38
8.2.180.0130.00316.63
8.2.170.0070.01422.96
8.2.160.0070.00720.39
8.2.150.0040.00424.18
8.2.140.0000.00724.66
8.2.130.0080.00826.16
8.2.120.0100.00320.96
8.2.110.0070.00320.34
8.2.100.0120.00019.36
8.2.90.0050.00318.24
8.2.80.0030.00517.97
8.2.70.0040.00417.50
8.2.60.0000.00817.93
8.2.50.0050.00318.07
8.2.40.0040.00417.94
8.2.30.0040.00418.11
8.2.20.0040.00417.60
8.2.10.0030.00618.11
8.2.00.0040.00417.77
8.1.280.0040.01425.92
8.1.270.0060.01223.91
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0100.00022.14
8.1.230.0030.00720.79
8.1.220.0030.00617.79
8.1.210.0090.00018.84
8.1.200.0030.00717.35
8.1.190.0050.00317.10
8.1.180.0040.00418.10
8.1.170.0000.00718.59
8.1.160.0040.00422.00
8.1.150.0050.00318.86
8.1.140.0050.00217.38
8.1.130.0030.00317.81
8.1.120.0070.00017.43
8.1.110.0000.00717.47
8.1.100.0000.00717.46
8.1.90.0000.00717.40
8.1.80.0000.00717.45
8.1.70.0030.00317.46
8.1.60.0000.00817.43
8.1.50.0030.00617.43
8.1.40.0040.00417.40
8.1.30.0080.00017.58
8.1.20.0030.00517.66
8.1.10.0040.00417.58
8.1.00.0030.00617.52
8.0.300.0050.00320.11
8.0.290.0050.00216.63
8.0.280.0040.00418.43
8.0.270.0050.00317.19
8.0.260.0030.00318.41
8.0.250.0070.00016.97
8.0.240.0080.00016.97
8.0.230.0060.00016.96
8.0.220.0030.00316.75
8.0.210.0030.00416.89
8.0.200.0000.00716.85
8.0.190.0090.00016.81
8.0.180.0070.00016.80
8.0.170.0000.00816.74
8.0.160.0030.00516.88
8.0.150.0000.00716.86
8.0.140.0000.00816.87
8.0.130.0080.00013.32
8.0.120.0080.00016.91
8.0.110.0000.00716.89
8.0.100.0040.00416.68
8.0.90.0040.00416.90
8.0.80.0130.00916.93
8.0.70.0000.00716.88
8.0.60.0030.00516.91
8.0.50.0030.00516.75
8.0.30.0150.00817.16
8.0.20.0120.01117.40
8.0.10.0030.00516.95
8.0.00.0070.01216.72
7.4.330.0000.00515.15
7.4.320.0030.00316.50
7.4.300.0070.00016.57
7.4.290.0030.00316.51
7.4.280.0080.00016.50
7.4.270.0000.00616.43
7.4.260.0030.00616.57
7.4.250.0040.00416.41
7.4.240.0020.00516.63
7.4.230.0030.00316.48
7.4.220.0100.00716.46
7.4.210.0050.01016.52
7.4.200.0020.00516.69
7.4.160.0030.01316.45
7.4.150.0120.01417.40
7.4.140.0070.01117.86
7.4.130.0130.00416.38
7.4.120.0060.01116.47
7.4.110.0090.00916.39
7.4.100.0070.01016.48
7.4.90.0140.00316.43
7.4.80.0100.01319.39
7.4.70.0100.00816.33
7.4.60.0090.00916.45
7.4.50.0000.00616.18
7.4.40.0060.01116.47
7.4.30.0040.01316.40
7.4.00.0060.01015.03
7.3.330.0000.00513.02
7.3.320.0040.00212.93
7.3.310.0040.00416.16
7.3.300.0020.00516.28
7.3.290.0040.01116.32
7.3.280.0110.00616.25
7.3.270.0130.00817.40
7.3.260.0080.00816.47
7.3.250.0060.01016.63
7.3.240.0080.01316.26
7.3.230.0140.00416.45
7.3.210.0060.01316.52
7.3.200.0040.01216.63
7.3.190.0210.00016.26
7.3.180.0060.01216.32
7.3.170.0030.01216.66
7.3.160.0080.00816.45
7.3.120.0090.00914.74
7.3.110.0090.00914.82
7.3.100.0090.00614.52
7.3.90.0060.00615.09
7.3.80.0070.00714.80
7.3.70.0090.00914.79
7.3.60.0030.00914.93
7.3.50.0040.01114.71
7.3.40.0080.00414.86
7.3.30.0040.01114.67
7.3.20.0040.01416.70
7.3.10.0040.00816.68
7.3.00.0040.00816.66
7.2.330.0140.01216.74
7.2.320.0150.00616.49
7.2.310.0060.01216.61
7.2.300.0030.01316.43
7.2.290.0050.01116.68
7.2.250.0030.01715.17
7.2.240.0100.01015.20
7.2.230.0040.01214.84
7.2.220.0030.01215.08
7.2.210.0040.01515.25
7.2.200.0000.00915.04
7.2.190.0000.01215.14
7.2.180.0090.00615.22
7.2.170.0080.00515.04
7.1.330.0030.01015.85
7.1.320.0120.00015.86
7.1.310.0140.00315.53
7.1.300.0090.00615.88
7.1.290.0040.00415.97
7.1.280.0080.00815.38
7.1.270.0090.00915.79
7.1.260.0000.01415.91
7.1.200.0030.01015.59
7.1.70.0040.00816.93
7.1.60.0110.01119.40
7.1.50.0120.00617.04
7.1.00.0030.07722.37
7.0.200.0030.00316.05
7.0.140.0030.07322.02
7.0.60.0030.07019.82
7.0.50.0070.08717.88
7.0.40.0070.07320.31
7.0.30.0270.04020.14
7.0.20.0330.07720.01
7.0.10.0100.08720.32
7.0.00.0100.08320.29
5.6.280.0070.07020.88
5.6.210.0000.08720.72
5.6.200.0070.06718.22
5.6.190.0070.04020.45
5.6.180.3400.04720.27
5.6.170.0200.07720.59
5.6.160.0130.07320.54
5.6.150.0170.07018.11
5.6.140.0100.05718.11
5.6.130.0170.07718.11
5.6.120.0030.08320.96
5.6.110.0030.04320.97
5.6.100.0070.08320.88
5.6.90.0100.08321.09
5.6.80.0070.07720.48
5.5.350.0270.06720.33
5.5.340.0070.05317.96
5.5.330.0070.07320.40
5.5.320.2700.04020.31
5.5.310.0300.06720.28
5.5.300.0030.08317.88
5.5.290.0100.08317.91
5.5.280.0130.08020.73
5.5.270.0130.06720.67
5.5.260.0170.07720.89
5.5.250.0170.08020.70
5.5.240.0000.08320.25
5.4.450.0700.05319.55
5.4.440.0230.05019.41
5.4.430.0070.05319.48
5.4.420.0130.05019.54
5.4.410.0100.05318.88
5.4.400.0300.05018.53
5.4.390.0370.04718.63
5.4.380.0130.04718.72
5.4.370.0100.04018.66
5.4.360.0100.04718.67
5.4.350.0080.03811.97
5.4.340.0050.03811.97
5.4.320.0050.03912.45
5.4.310.0050.03912.45
5.4.300.0030.03812.45
5.4.290.0030.04012.45
5.4.280.0070.03612.35
5.4.270.0060.03512.35
5.4.260.0070.03612.35
5.4.250.0060.03712.35
5.4.240.0050.03712.35
5.4.230.0080.03812.34
5.4.220.0050.03812.34
5.4.210.0070.03312.34
5.4.200.0080.04312.34
5.4.190.0050.03712.34
5.4.180.0070.03512.34
5.4.170.0060.04112.35
5.4.160.0060.03612.35
5.4.150.0060.03512.34
5.4.140.0080.03612.02
5.4.130.0070.03812.01
5.4.120.0070.03811.97
5.4.110.0040.03911.96
5.4.100.0090.03511.96
5.4.90.0050.03711.97
5.4.80.0040.03711.96
5.4.70.0050.03511.96
5.4.60.0040.03611.96
5.4.50.0040.03811.97
5.4.40.0030.03911.95
5.4.30.0040.03711.95
5.4.20.0050.03511.95
5.4.10.0050.03611.95
5.4.00.0040.03711.44
5.3.290.0060.03912.80
5.3.280.0040.04112.71
5.3.270.0080.03712.72
5.3.260.0080.03812.72
5.3.250.0050.03812.72
5.3.240.0040.03912.71
5.3.230.0050.04112.71
5.3.220.0070.04112.68
5.3.210.0040.04112.68
5.3.200.0040.03812.68
5.3.190.0090.03412.68
5.3.180.0070.03512.67
5.3.170.0090.03512.67
5.3.160.0060.03612.67
5.3.150.0050.03812.67
5.3.140.0090.03612.66
5.3.130.0060.03812.66
5.3.120.0070.03712.65
5.3.110.0030.04112.66
5.3.100.0050.03712.12
5.3.90.0060.04012.08
5.3.80.0060.03612.07
5.3.70.0040.03912.08
5.3.60.0050.03712.06
5.3.50.0070.03512.00
5.3.40.0040.03812.00
5.3.30.0060.03511.95
5.3.20.0060.03611.73
5.3.10.0060.03411.69
5.3.00.0040.03811.68
5.2.170.0060.0309.18
5.2.160.0070.0269.18
5.2.150.0040.0319.18
5.2.140.0050.0319.18
5.2.130.0040.0299.14
5.2.120.0060.0269.14
5.2.110.0040.0299.15
5.2.100.0060.0369.14
5.2.90.0040.0379.14
5.2.80.0060.0289.14
5.2.70.0040.0309.14
5.2.60.0030.0319.09
5.2.50.0060.0299.05
5.2.40.0020.0329.03
5.2.30.0040.0299.01
5.2.20.0070.0279.00
5.2.10.0020.0308.92
5.2.00.0020.0318.79
5.1.60.0070.0308.07
5.1.50.0050.0238.07
5.1.40.0020.0268.05
5.1.30.0070.0228.39
5.1.20.0050.0308.42
5.1.10.0050.0248.14
5.1.00.0040.0268.14
5.0.50.0030.0216.63
5.0.40.0040.0196.49
5.0.30.0010.0376.30
5.0.20.0060.0246.28
5.0.10.0040.0206.25
5.0.00.0020.0326.25
4.4.90.0020.0164.78
4.4.80.0030.0154.75
4.4.70.0050.0134.76
4.4.60.0050.0134.75
4.4.50.0020.0234.77
4.4.40.0080.0254.71
4.4.30.0030.0154.76
4.4.20.0020.0164.84
4.4.10.0030.0154.85
4.4.00.0020.0254.76
4.3.110.0030.0154.67
4.3.100.0010.0174.66
4.3.90.0030.0164.63
4.3.80.0030.0254.58
4.3.70.0050.0134.63
4.3.60.0060.0124.63
4.3.50.0020.0174.63
4.3.40.0030.0244.54
4.3.30.0040.0153.29
4.3.20.0020.0173.27
4.3.10.0000.0183.23
4.3.00.0170.0207.13

preferences:
66.86 ms | 401 KiB | 5 Q