3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dot($array, $prepend = '') { $results = array(); foreach ($array as $key => $value) { if (is_array($value)) { $results = array_merge($results, dot($value, $prepend.$key.'.')); } else { if ($key === 'foo') print_r($value); $results[$prepend.$key] = $value; } } return $results; } $array = [ 'foo' => [], 'bar' => [ 'baz' => 1 ] ]; print_r(dot($array));

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.00418.33
8.3.50.0100.00921.87
8.3.40.0040.01118.88
8.3.30.0100.00719.08
8.3.20.0000.00720.29
8.3.10.0030.00623.71
8.3.00.0040.00419.38
8.2.180.0060.00916.37
8.2.170.0040.01122.96
8.2.160.0060.00920.47
8.2.150.0050.00324.18
8.2.140.0090.00024.66
8.2.130.0070.00026.16
8.2.120.0000.00722.04
8.2.110.0000.01021.12
8.2.100.0030.00917.75
8.2.90.0050.00319.31
8.2.80.0050.00317.97
8.2.70.0000.01117.50
8.2.60.0000.00917.93
8.2.50.0050.00518.07
8.2.40.0040.00420.07
8.2.30.0050.00217.98
8.2.20.0040.00417.79
8.2.10.0080.00018.18
8.2.00.0030.00617.61
8.1.280.0090.01225.92
8.1.270.0040.00423.71
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00623.97
8.1.230.0090.00318.85
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0070.00417.48
8.1.190.0040.00417.22
8.1.180.0040.00418.10
8.1.170.0090.00020.37
8.1.160.0050.00322.05
8.1.150.0000.00718.88
8.1.140.0040.00417.38
8.1.130.0000.00717.82
8.1.120.0070.00017.37
8.1.110.0030.00617.45
8.1.100.0000.00817.40
8.1.90.0070.00017.46
8.1.80.0070.00017.32
8.1.70.0040.00417.42
8.1.60.0100.00517.54
8.1.50.0030.00517.53
8.1.40.0030.00517.48
8.1.30.0030.00517.63
8.1.20.0050.00217.66
8.1.10.0050.00317.50
8.1.00.0000.00717.60
8.0.300.0050.00318.77
8.0.290.0070.00016.63
8.0.280.0000.00718.42
8.0.270.0070.00017.30
8.0.260.0030.00317.23
8.0.250.0030.00316.94
8.0.240.0030.00316.98
8.0.230.0070.00016.96
8.0.220.0000.00716.92
8.0.210.0030.00316.79
8.0.200.0030.00316.90
8.0.190.0000.00816.95
8.0.180.0030.00516.89
8.0.170.0080.00016.95
8.0.160.0070.00016.98
8.0.150.0050.00316.66
8.0.140.0000.00716.87
8.0.130.0000.00613.30
8.0.120.0030.00516.86
8.0.110.0000.00716.88
8.0.100.0000.00716.81
8.0.90.0040.00416.76
8.0.80.0130.00316.79
8.0.70.0000.00816.87
8.0.60.0040.00416.74
8.0.50.0050.00216.77
8.0.30.0090.01016.90
8.0.20.0110.00917.40
8.0.10.0050.00316.78
8.0.00.0090.01216.68
7.4.330.0000.00615.02
7.4.320.0030.00316.60
7.4.300.0030.00316.64
7.4.290.0000.00716.48
7.4.280.0040.00416.61
7.4.270.0030.00316.43
7.4.260.0070.00016.38
7.4.250.0040.00416.48
7.4.240.0000.00716.59
7.4.230.0030.00316.57
7.4.220.0100.00716.43
7.4.210.0110.00716.53
7.4.200.0030.00316.57
7.4.160.0170.00616.30
7.4.150.0080.01317.40
7.4.140.0080.01317.86
7.4.130.0060.01116.47
7.4.120.0120.00516.57
7.4.110.0060.01616.53
7.4.100.0090.00916.55
7.4.90.0030.01316.57
7.4.80.0040.01516.30
7.4.70.0090.01516.39
7.4.60.0130.00716.64
7.4.50.0060.00316.47
7.4.40.0100.00716.50
7.4.30.0100.00716.46
7.4.00.0080.00815.09
7.3.330.0030.00313.29
7.3.320.0050.00013.34
7.3.310.0000.00816.37
7.3.300.0070.00016.41
7.3.290.0100.00816.38
7.3.280.0080.01016.37
7.3.270.0150.00617.40
7.3.260.0100.01016.58
7.3.250.0090.01216.57
7.3.240.0100.01016.45
7.3.230.0070.01016.58
7.3.210.0000.01616.30
7.3.200.0090.00919.39
7.3.190.0090.00916.45
7.3.180.0070.01016.41
7.3.170.0070.01016.39
7.3.160.0120.01216.38
7.3.120.0030.01714.79
7.3.110.0040.01514.46
7.3.100.0040.01114.92
7.3.90.0090.00914.86
7.3.80.0140.00314.87
7.3.70.0070.01014.81
7.3.60.0040.00714.84
7.3.50.0060.00614.82
7.3.40.0070.00714.60
7.3.30.0120.00014.77
7.3.20.0060.01016.73
7.3.10.0100.00316.64
7.3.00.0100.00716.68
7.2.330.0070.01016.45
7.2.320.0030.01316.77
7.2.310.0070.01016.82
7.2.300.0150.00616.51
7.2.290.0170.00716.65
7.2.250.0030.01615.25
7.2.240.0070.01415.22
7.2.230.0040.01414.93
7.2.220.0100.00314.96
7.2.210.0070.01015.21
7.2.200.0070.01115.05
7.2.190.0100.00315.05
7.2.180.0000.01515.05
7.2.170.0060.00615.12
7.1.330.0070.01015.88
7.1.320.0090.00615.73
7.1.310.0040.01515.79
7.1.300.0030.01015.86
7.1.290.0030.00615.74
7.1.280.0060.00616.01
7.1.270.0090.00915.90
7.1.260.0060.00915.93
7.1.70.0030.00317.27
7.1.60.0120.01219.32
7.1.50.0000.01216.96
7.1.00.0070.07322.33
7.0.200.0030.00316.55
7.0.140.0000.07722.07
7.0.60.0070.08019.90
7.0.50.0070.05017.86
7.0.40.0070.08320.21
7.0.30.0300.07720.27
7.0.20.0330.07720.06
7.0.10.0130.08320.09
7.0.00.0100.06020.20
5.6.280.0030.07321.08
5.6.210.0030.04020.47
5.6.200.0000.05318.29
5.6.190.0000.06320.57
5.6.180.0170.04720.39
5.6.170.0230.08720.50
5.6.160.0100.07720.48
5.6.150.0100.08018.29
5.6.140.0130.07318.25
5.6.130.0000.06718.11
5.6.120.0100.05321.00
5.6.110.0030.04320.99
5.6.100.0170.07321.00
5.6.90.0130.06720.97
5.6.80.0130.07320.51
5.6.70.3930.03320.29
5.5.350.0330.05720.37
5.5.340.0030.03717.99
5.5.330.0100.07020.40
5.5.320.0300.05720.51
5.5.310.0200.08720.26
5.5.300.0030.04018.08
5.5.290.0030.07017.91
5.5.280.0070.07720.89
5.5.270.0030.06720.96
5.5.260.0000.06020.68
5.5.250.0030.04320.46
5.5.240.0300.07020.16
5.4.450.0070.06019.70
5.4.440.0900.07719.61
5.4.430.0700.06719.58
5.4.420.0730.07719.48
5.4.410.1130.06319.34
5.4.400.0670.05719.11
5.4.390.0730.07719.15
5.4.380.0970.06318.84
5.4.370.0500.06319.30
5.4.360.0800.06019.16
5.4.350.0630.05719.31
5.4.340.0040.03812.02
5.4.320.0100.03212.50
5.4.310.0060.03812.50
5.4.300.0070.03912.50
5.4.290.0060.03912.50
5.4.280.0120.03012.40
5.4.270.0040.03712.39
5.4.260.0070.03612.40
5.4.250.0030.04012.40
5.4.240.0070.03512.39
5.4.230.0040.04112.39
5.4.220.0080.03612.39
5.4.210.0060.03912.39
5.4.200.0040.04312.39
5.4.190.0060.03712.39
5.4.180.0110.03912.39
5.4.170.0090.03712.39
5.4.160.0130.03212.39
5.4.150.0070.03512.39
5.4.140.0050.03912.07
5.4.130.0040.03712.06
5.4.120.0070.03412.01
5.4.110.0040.03612.01
5.4.100.0030.03712.02
5.4.90.0050.03612.01
5.4.80.0110.03512.02
5.4.70.0090.03112.01
5.4.60.0040.03512.01
5.4.50.0070.03512.01
5.4.40.0060.03312.00
5.4.30.0090.03211.99
5.4.20.0080.03211.99
5.4.10.0050.03412.00
5.4.00.0080.03311.48
5.3.290.0070.04412.80
5.3.280.0070.03812.71
5.3.270.0050.04112.72
5.3.260.0060.04012.72
5.3.250.0080.03512.72
5.3.240.0070.03612.72
5.3.230.0050.03812.71
5.3.220.0030.03912.68
5.3.210.0070.03812.68
5.3.200.0040.03812.68
5.3.190.0060.03812.67
5.3.180.0060.03512.67
5.3.170.0070.03612.67
5.3.160.0100.03812.67
5.3.150.0060.03912.67
5.3.140.0070.03512.66
5.3.130.0050.03912.66
5.3.120.0040.04112.66
5.3.110.0070.03812.66
5.3.100.0050.03812.12
5.3.90.0090.04912.10
5.3.80.0040.03912.09
5.3.70.0060.03812.09
5.3.60.0060.03612.08
5.3.50.0040.03712.03
5.3.40.0040.03812.02
5.3.30.0110.03011.99
5.3.20.0040.03711.77
5.3.10.0040.03511.73
5.3.00.0080.03611.71
5.2.170.0030.0319.22
5.2.160.0030.0299.22
5.2.150.0020.0329.21
5.2.140.0040.0339.21
5.2.130.0060.0279.18
5.2.120.0050.0299.18
5.2.110.0070.0279.18
5.2.100.0060.0269.18
5.2.90.0040.0319.18
5.2.80.0020.0339.18
5.2.70.0030.0389.17
5.2.60.0040.0329.13
5.2.50.0060.0309.10
5.2.40.0030.0309.07
5.2.30.0050.0309.05
5.2.20.0060.0349.04
5.2.10.0060.0268.95
5.2.00.0040.0338.81
5.1.60.0090.0278.09
5.1.50.0050.0248.09
5.1.40.0040.0248.07
5.1.30.0030.0268.42
5.1.20.0040.0278.44
5.1.10.0070.0258.16
5.1.00.0050.0258.16
5.0.50.0030.0206.64
5.0.40.0010.0216.51
5.0.30.0000.0346.31
5.0.20.0040.0186.28
5.0.10.0040.0196.27
5.0.00.0050.0296.25
4.4.90.0040.0144.78
4.4.80.0030.0154.75
4.4.70.0050.0134.75
4.4.60.0030.0154.76
4.4.50.0020.0164.77
4.4.40.0030.0254.70
4.4.30.0030.0154.76
4.4.20.0000.0174.85
4.4.10.0030.0154.85
4.4.00.0010.0314.76
4.3.110.0040.0144.67
4.3.100.0050.0134.66
4.3.90.0030.0144.63
4.3.80.0040.0304.59
4.3.70.0050.0144.63
4.3.60.0030.0144.62
4.3.50.0010.0174.63
4.3.40.0030.0234.54
4.3.30.0010.0173.30
4.3.20.0030.0183.28
4.3.10.0020.0163.25
4.3.00.0070.0236.99

preferences:
38.38 ms | 401 KiB | 5 Q