3v4l.org

run code in 300+ PHP versions simultaneously
<?php function flatten($inputArray) { $output = ''; foreach ($inputArray as $element) { if (is_array($element) == true) { $output .= flatten($element); }else { $output .= $element; } } return $output;}$print = array( 'orange', 'green', array( 'yellow', 'white' ));echo flatten($print);

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.0140.00016.75
8.3.50.0120.00722.93
8.3.40.0170.00318.71
8.3.30.0070.00719.10
8.3.20.0000.00720.09
8.3.10.0000.00823.36
8.3.00.0080.00017.48
8.2.180.0160.00016.63
8.2.170.0040.01122.96
8.2.160.0120.00320.35
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00420.96
8.2.110.0060.00322.16
8.2.100.0060.00617.91
8.2.90.0040.00419.13
8.2.80.0000.00817.97
8.2.70.0080.00017.63
8.2.60.0000.00918.02
8.2.50.0090.00018.07
8.2.40.0060.00318.17
8.2.30.0000.00718.19
8.2.20.0040.00417.74
8.2.10.0000.00818.11
8.2.00.0040.00417.54
8.1.280.0100.00325.92
8.1.270.0050.00323.91
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0000.00923.85
8.1.230.0110.00018.86
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0030.00617.35
8.1.190.0000.00817.00
8.1.180.0040.00418.10
8.1.170.0000.00818.50
8.1.160.0000.00722.01
8.1.150.0040.00418.89
8.1.140.0000.00717.50
8.1.130.0000.00717.69
8.1.120.0070.00017.50
8.1.110.0070.00017.35
8.1.100.0000.00817.35
8.1.90.0070.00017.45
8.1.80.0070.00017.48
8.1.70.0000.00717.33
8.1.60.0050.00317.57
8.1.50.0050.00317.58
8.1.40.0040.00417.44
8.1.30.0030.00517.52
8.1.20.0030.00617.59
8.1.10.0040.00417.48
8.1.00.0050.00217.32
8.0.300.0000.00718.77
8.0.290.0000.00716.75
8.0.280.0000.00718.42
8.0.270.0070.00217.16
8.0.260.0060.00017.26
8.0.250.0070.00016.87
8.0.240.0000.00816.96
8.0.230.0040.00416.95
8.0.220.0070.00016.85
8.0.210.0070.00016.79
8.0.200.0000.00616.79
8.0.190.0030.00316.86
8.0.180.0070.00016.94
8.0.170.0030.00516.88
8.0.160.0000.00716.95
8.0.150.0000.00716.86
8.0.140.0070.00016.85
8.0.130.0000.00513.35
8.0.120.0040.00416.84
8.0.110.0000.00716.76
8.0.100.0000.00716.68
8.0.90.0070.00016.82
8.0.80.0060.00916.75
8.0.70.0000.00716.95
8.0.60.0040.00416.71
8.0.50.0000.00716.67
8.0.30.0080.01117.26
8.0.20.0080.01017.40
8.0.10.0070.00016.81
8.0.00.0110.00616.87
7.4.330.0000.00615.10
7.4.320.0060.00016.43
7.4.300.0000.00616.40
7.4.290.0080.00016.49
7.4.280.0000.00716.53
7.4.270.0000.00716.63
7.4.260.0030.00516.56
7.4.250.0040.00416.53
7.4.240.0000.00716.50
7.4.230.0030.00316.68
7.4.220.0090.00916.49
7.4.210.0120.00916.52
7.4.200.0030.00316.48
7.4.160.0100.01316.61
7.4.150.0120.00617.40
7.4.140.0100.00717.86
7.4.130.0100.00916.52
7.4.120.0090.00816.54
7.4.110.0120.00916.56
7.4.100.0090.00916.66
7.4.90.0100.00716.53
7.4.80.0110.01119.39
7.4.70.0070.01016.63
7.4.60.0160.00016.41
7.4.50.0000.00816.55
7.4.40.0070.01016.24
7.4.30.0140.00316.59
7.4.00.0080.00014.59
7.3.330.0050.00013.17
7.3.320.0020.00313.17
7.3.310.0030.00316.25
7.3.300.0000.00716.29
7.3.290.0000.01416.37
7.3.280.0100.00616.35
7.3.270.0090.00917.40
7.3.260.0070.01016.43
7.3.250.0110.01116.45
7.3.240.0070.01016.47
7.3.230.0100.00616.39
7.3.210.0100.00716.64
7.3.200.0150.00319.39
7.3.190.0100.01216.41
7.3.180.0050.01116.49
7.3.170.0120.00416.57
7.3.160.0090.00616.39
7.3.10.0120.00316.34
7.3.00.0070.00316.55
7.2.330.0030.01516.52
7.2.320.0200.00316.46
7.2.310.0110.00716.78
7.2.300.0000.01616.67
7.2.290.0060.00916.52
7.2.130.0110.00016.76
7.2.120.0030.00916.79
7.2.110.0080.00416.93
7.2.100.0070.00716.67
7.2.90.0030.00716.64
7.2.80.0040.00416.71
7.2.70.0070.00316.96
7.2.60.0030.01016.86
7.2.50.0050.00716.84
7.2.40.0000.01116.81
7.2.30.0070.00316.86
7.2.20.0110.00316.84
7.2.10.0030.00616.82
7.2.00.0030.01318.05
7.1.250.0070.00315.87
7.1.200.0110.00015.70
7.1.100.0030.00918.32
7.1.70.0000.01617.09
7.1.60.0000.02419.40
7.1.50.0080.01217.02
7.1.00.0000.08022.28
7.0.200.0030.00516.77
7.0.140.0030.06722.04
7.0.60.0070.08019.83
7.0.50.0030.05717.87
7.0.40.0070.08320.20
7.0.30.0300.06720.20
7.0.20.0300.08020.12
7.0.10.0030.04720.19
7.0.00.0100.08020.19
5.6.280.0100.06720.93
5.6.210.0030.04020.47
5.6.200.0070.05018.22
5.6.190.0030.08320.41
5.6.180.3930.04320.48
5.6.170.0230.07320.55
5.6.160.0070.05320.44
5.6.150.0170.07318.18
5.6.140.0000.05318.15
5.6.130.0030.08718.29
5.6.120.0070.08021.10
5.6.110.0100.08720.98
5.6.100.0070.08021.13
5.6.90.0070.04020.96
5.6.80.0170.04720.53
5.6.70.4500.04320.53
5.5.350.0170.08320.43
5.5.340.0100.07718.02
5.5.330.0030.05020.30
5.5.320.3530.04320.38
5.5.310.0230.06020.39
5.5.300.0030.08318.09
5.5.290.0030.06718.09
5.5.280.0100.08320.80
5.5.270.0130.07020.79
5.5.260.0100.08020.86
5.5.250.0030.04020.64
5.5.240.0200.07320.12
5.4.450.0330.04319.57
5.4.440.0330.04319.41
5.4.430.1070.03719.52
5.4.420.0270.04319.49
5.4.410.0500.04019.39
5.4.400.0530.03719.14
5.4.390.0300.04719.20
5.4.380.0800.06318.59
5.4.370.0170.04318.52
5.4.360.0900.05018.73
5.4.350.0570.05318.66
5.4.340.1130.04718.51
5.4.320.0060.03912.50
5.4.310.0060.03812.50
5.4.300.0080.04312.50
5.4.290.0080.04612.50
5.4.280.0050.03512.40
5.4.270.0080.03512.40
5.4.260.0050.04112.40
5.4.250.0090.03612.40
5.4.240.0110.03812.40
5.4.230.0060.03812.39
5.4.220.0070.03912.39
5.4.210.0060.03612.39
5.4.200.0110.03312.39
5.4.190.0040.03712.39
5.4.180.0040.03712.39
5.4.170.0090.03212.39
5.4.160.0040.03812.39
5.4.150.0090.03312.38
5.4.140.0060.03612.07
5.4.130.0060.03312.06
5.4.120.0060.03412.02
5.4.110.0060.03312.01
5.4.100.0080.03112.01
5.4.90.0060.03512.01
5.4.80.0040.03712.01
5.4.70.0080.03112.00
5.4.60.0070.03212.01
5.4.50.0070.03912.01
5.4.40.0080.03512.00
5.4.30.0040.03611.99
5.4.20.0060.03411.99
5.4.10.0060.03411.99
5.4.00.0050.03611.48
5.3.290.0040.04012.80
5.3.280.0040.03812.70
5.3.270.0070.04812.73
5.3.260.0070.03612.71
5.3.250.0060.03512.72
5.3.240.0060.03512.72
5.3.230.0060.03612.70
5.3.220.0100.03912.68
5.3.210.0050.04212.68
5.3.200.0060.03612.68
5.3.190.0050.04112.68
5.3.180.0050.03612.67
5.3.170.0050.03612.67
5.3.160.0060.03712.67
5.3.150.0070.03512.68
5.3.140.0080.03412.66
5.3.130.0030.04012.66
5.3.120.0050.04612.66
5.3.110.0050.04112.66
5.3.100.0040.04012.12
5.3.90.0090.03312.10
5.3.80.0040.03812.09
5.3.70.0070.03512.09
5.3.60.0050.03612.07
5.3.50.0080.03312.02
5.3.40.0060.03512.02
5.3.30.0060.03311.98
5.3.20.0030.03811.76
5.3.10.0050.03511.73
5.3.00.0070.03911.71
5.2.170.0060.0319.21
5.2.160.0030.0309.22
5.2.150.0030.0329.22
5.2.140.0050.0309.21
5.2.130.0010.0339.17
5.2.120.0080.0249.17
5.2.110.0030.0309.18
5.2.100.0040.0369.17
5.2.90.0040.0299.17
5.2.80.0020.0329.17
5.2.70.0050.0309.17
5.2.60.0040.0319.13
5.2.50.0050.0299.09
5.2.40.0050.0319.07
5.2.30.0030.0319.04
5.2.20.0050.0309.04
5.2.10.0040.0298.94
5.2.00.0060.0358.80
5.1.60.0010.0268.09
5.1.50.0040.0248.08
5.1.40.0060.0218.06
5.1.30.0040.0278.41
5.1.20.0070.0258.43
5.1.10.0070.0248.16
5.1.00.0060.0268.16
5.0.50.0020.0226.63
5.0.40.0030.0196.50
5.0.30.0040.0306.31
5.0.20.0040.0186.28
5.0.10.0020.0206.25
5.0.00.0040.0296.25
4.4.90.0010.0174.78
4.4.80.0030.0144.76
4.4.70.0040.0184.75
4.4.60.0040.0164.76
4.4.50.0020.0184.77
4.4.40.0010.0284.71
4.4.30.0010.0184.76
4.4.20.0030.0204.84
4.4.10.0030.0164.85
4.4.00.0050.0234.76
4.3.110.0000.0184.67
4.3.100.0020.0184.66
4.3.90.0010.0154.64
4.3.80.0030.0234.59
4.3.70.0030.0184.63
4.3.60.0070.0214.63
4.3.50.0020.0164.62
4.3.40.0020.0324.53
4.3.30.0040.0133.30
4.3.20.0020.0153.28
4.3.10.0020.0213.24
4.3.00.0070.01715.97

preferences:
64.15 ms | 401 KiB | 5 Q