3v4l.org

run code in 300+ PHP versions simultaneously
<?php $items = array( array( 'forename' => 'Foo', 'surname' => 'sdfsd' ), array( 'forename' => 'Bar', 'surname' => 'Foo' ) ); $arr = array(); foreach($items as $item){ $arr['name'][] = $item['forename']; $arr['surname'][] = $item['surname']; } echo "<pre>".print_r($arr, true)."</pre>"; ?>

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.70.0160.00016.63
8.3.60.0120.00616.50
8.3.50.0090.01122.82
8.3.40.0070.00718.81
8.3.30.0030.01019.21
8.3.20.0040.00420.21
8.3.10.0050.00520.65
8.3.00.0050.00319.38
8.2.180.0100.01018.42
8.2.170.0180.00318.93
8.2.160.0110.00322.96
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0090.00026.16
8.2.120.0030.00620.97
8.2.110.0060.00320.52
8.2.100.0040.00718.03
8.2.90.0040.00419.25
8.2.80.0050.00317.97
8.2.70.0000.00817.50
8.2.60.0040.00418.05
8.2.50.0030.00618.07
8.2.40.0060.00318.16
8.2.30.0070.00019.35
8.2.20.0000.00717.75
8.2.10.0040.00418.05
8.2.00.0040.00417.74
8.1.280.0030.01425.92
8.1.270.0060.00322.17
8.1.260.0070.00026.35
8.1.250.0030.00528.09
8.1.240.0080.00023.83
8.1.230.0060.00619.15
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0000.01217.22
8.1.190.0040.00417.22
8.1.180.0040.00418.10
8.1.170.0040.00418.64
8.1.160.0000.00721.92
8.1.150.0040.00418.85
8.1.140.0000.00717.39
8.1.130.0030.00317.79
8.1.120.0000.00717.42
8.1.110.0040.00417.43
8.1.100.0040.00417.49
8.1.90.0030.00317.45
8.1.80.0000.00717.37
8.1.70.0000.00717.40
8.1.60.0080.00017.60
8.1.50.0050.00317.47
8.1.40.0090.00017.51
8.1.30.0050.00317.64
8.1.20.0000.00817.70
8.1.10.0000.00717.43
8.1.00.0040.00417.55
8.0.300.0040.00418.77
8.0.290.0030.00516.63
8.0.280.0030.00318.43
8.0.270.0030.00317.28
8.0.260.0000.00817.16
8.0.250.0070.00016.96
8.0.240.0060.00016.84
8.0.230.0000.00616.86
8.0.220.0000.00716.88
8.0.210.0000.00716.89
8.0.200.0000.00616.93
8.0.190.0040.00416.84
8.0.180.0000.00716.88
8.0.170.0000.00716.92
8.0.160.0030.00316.84
8.0.150.0000.00716.86
8.0.140.0000.00716.71
8.0.130.0000.00613.29
8.0.120.0040.00416.91
8.0.110.0000.00816.86
8.0.100.0040.00416.80
8.0.90.0000.00816.77
8.0.80.0080.00816.83
8.0.70.0000.00816.77
8.0.60.0050.00316.99
8.0.50.0040.00416.77
8.0.30.0130.00617.21
8.0.20.0090.00917.40
8.0.10.0080.00017.05
8.0.00.0060.01216.71
7.4.330.0050.00015.03
7.4.320.0030.00316.48
7.4.300.0030.00316.41
7.4.290.0040.00416.51
7.4.280.0030.00516.54
7.4.270.0000.00716.55
7.4.260.0030.00316.61
7.4.250.0000.00816.61
7.4.240.0020.00516.61
7.4.230.0070.00016.48
7.4.220.0090.00916.61
7.4.210.0090.00616.71
7.4.200.0000.00716.60
7.4.160.0030.01316.50
7.4.150.0060.01417.40
7.4.140.0100.00717.86
7.4.130.0110.00516.53
7.4.120.0090.00916.51
7.4.110.0100.00716.48
7.4.100.0190.00816.45
7.4.90.0030.01616.55
7.4.80.0140.01119.39
7.4.70.0130.00716.45
7.4.60.0060.01016.57
7.4.50.0030.00516.38
7.4.40.0090.00916.73
7.4.30.0090.00616.70
7.4.00.0060.01015.12
7.3.330.0000.00613.23
7.3.320.0000.00613.21
7.3.310.0030.00316.20
7.3.300.0060.00016.32
7.3.290.0160.00316.36
7.3.280.0080.01116.38
7.3.270.0100.00717.40
7.3.260.0110.00616.44
7.3.250.0120.00516.37
7.3.240.0150.00716.33
7.3.230.0060.01116.47
7.3.210.0060.01016.59
7.3.200.0060.01219.39
7.3.190.0070.01016.66
7.3.180.0100.00916.50
7.3.170.0110.00816.36
7.3.160.0090.00616.46
7.3.00.0100.00716.57
7.2.330.0120.00416.53
7.2.320.0060.01216.72
7.2.310.0060.01316.49
7.2.300.0080.00916.55
7.2.290.0070.01016.73
7.2.130.0090.00916.75
7.2.120.0060.01017.00
7.2.110.0060.00917.04
7.2.100.0100.00717.01
7.2.90.0040.00716.94
7.2.80.0060.00916.94
7.2.70.0040.01116.98
7.2.60.0090.00316.79
7.2.50.0060.00617.09
7.2.40.0070.00316.98
7.2.30.0030.01216.98
7.2.20.0060.00317.14
7.2.10.0030.00916.92
7.2.00.0090.00518.16
7.1.250.0000.00915.79
7.1.240.0000.01116.07
7.1.230.0000.01115.89
7.1.220.0000.01515.89
7.1.210.0040.01115.66
7.1.200.0070.00715.82
7.1.190.0040.01115.62
7.1.180.0030.00715.80
7.1.170.0050.00515.84
7.1.160.0090.00315.87
7.1.150.0070.00715.77
7.1.140.0030.00915.74
7.1.130.0040.00415.93
7.1.120.0110.00415.84
7.1.110.0080.00515.84
7.1.100.0030.00916.89
7.1.90.0060.00315.78
7.1.80.0040.00815.92
7.1.70.0070.00716.47
7.1.60.0070.01217.59
7.1.50.0120.00816.28
7.1.40.0030.00615.78
7.1.30.0090.00315.61
7.1.20.0030.00915.71
7.1.10.0070.00415.58
7.1.00.0050.04019.07
7.0.330.0030.01315.63
7.0.320.0000.01515.54
7.0.310.0060.00315.43
7.0.300.0060.00915.05
7.0.290.0000.00815.18
7.0.280.0030.00715.54
7.0.270.0090.00615.31
7.0.260.0080.00815.39
7.0.250.0100.00615.48
7.0.240.0000.01515.27
7.0.230.0060.00915.45
7.0.220.0030.00615.43
7.0.210.0030.01015.41
7.0.200.0070.00916.14
7.0.190.0040.00815.43
7.0.180.0030.01015.48
7.0.170.0130.00015.55
7.0.160.0030.00615.14
7.0.150.0090.00315.39
7.0.140.0050.04018.75
7.0.130.0030.01015.41
7.0.120.0030.00615.29
7.0.110.0090.00315.59
7.0.100.0000.00815.22
7.0.90.0060.01015.51
7.0.80.0040.01115.27
7.0.70.0030.01015.50
7.0.60.0020.02417.57
7.0.50.0020.02916.63
7.0.40.0090.04516.83
7.0.30.0160.03216.77
7.0.20.0120.02516.89
7.0.10.0130.04216.92
7.0.00.0080.04116.92
5.6.380.0090.00314.52
5.6.370.0060.00614.40
5.6.360.0060.00914.56
5.6.350.0110.00414.51
5.6.340.0000.01114.82
5.6.330.0030.01014.58
5.6.320.0030.01014.48
5.6.310.0000.00914.68
5.6.300.0000.01414.15
5.6.290.0000.01014.25
5.6.280.0050.04117.96
5.6.270.0070.01014.71
5.6.260.0090.00914.45
5.6.250.0040.01114.30
5.6.240.0080.00314.45
5.6.230.0100.00014.43
5.6.220.0000.01514.39
5.6.210.0100.04217.71
5.6.200.0040.02516.23
5.6.190.0050.02617.72
5.6.180.1680.02317.56
5.6.170.0120.02517.51
5.6.160.0060.04617.56
5.6.150.0080.04016.31
5.6.140.0070.02316.25
5.6.130.0070.02216.43
5.6.120.0070.02517.84
5.6.110.0050.04517.71
5.6.100.0080.04217.79
5.6.90.0090.03017.74
5.6.80.0120.04417.54
5.6.70.0110.00314.39
5.6.60.0040.01114.20
5.6.50.0060.00914.18
5.6.40.0160.00014.10
5.6.30.0060.00914.39
5.6.20.0030.00814.33
5.6.10.0040.00414.26
5.6.00.0030.01014.37
5.5.380.0040.00711.27
5.5.370.0040.00711.21
5.5.360.0060.00611.45
5.5.350.0160.02315.78
5.5.340.0080.02514.71
5.5.330.0050.04015.89
5.5.320.0180.02015.78
5.5.310.0250.03315.73
5.5.300.0100.03214.74
5.5.290.0030.04314.66
5.5.280.0080.02316.21
5.5.270.0020.03916.21
5.5.260.0030.03516.01
5.5.250.0040.03915.95
5.5.240.0060.03815.72
5.5.230.0070.00311.27
5.5.220.0000.00611.18
5.5.210.0000.00911.44
5.5.200.0030.00311.11
5.5.190.0000.00711.46
5.5.180.0000.01011.43
5.5.170.0030.01011.35
5.5.160.0000.01011.20
5.5.150.0000.00811.47
5.5.140.0030.01010.82
5.5.130.0000.00611.44
5.5.120.0050.00311.21
5.5.110.0000.00611.16
5.5.100.0040.00811.42
5.5.90.0070.00311.07
5.5.80.0000.00611.41
5.5.70.0030.00911.05
5.5.60.0090.00011.32
5.5.50.0050.00511.36
5.5.40.0030.00311.18
5.5.30.0000.00511.38
5.5.20.0070.00411.20
5.5.10.0030.00811.41
5.5.00.0030.00610.90
5.4.450.0130.02115.34
5.4.440.0100.02015.41
5.4.430.0120.02915.38
5.4.420.0170.03215.36
5.4.410.0090.02815.23
5.4.400.0100.02915.01
5.4.390.0170.02215.28
5.4.380.0130.03014.82
5.4.370.0100.04014.92
5.4.360.0180.01914.85
5.4.350.0020.03814.98
5.4.340.0120.02714.86
5.4.330.0070.00411.17
5.4.320.0040.02311.84
5.4.310.0060.02111.76
5.4.300.0070.02111.87
5.4.290.0060.01911.71
5.4.280.0060.02111.63
5.4.270.0050.02111.92
5.4.260.0040.02311.82
5.4.250.0060.02211.69
5.4.240.0080.02011.63
5.4.230.0040.02211.74
5.4.220.0050.01811.72
5.4.210.0070.01811.77
5.4.200.0060.02011.81
5.4.190.0050.02811.80
5.4.180.0050.02211.78
5.4.170.0060.02011.77
5.4.160.0090.02511.80
5.4.150.0020.02311.80
5.4.140.0100.02011.51
5.4.130.0110.02211.54
5.4.120.0070.02111.45
5.4.110.0070.01911.62
5.4.100.0060.02511.46
5.4.90.0070.02011.48
5.4.80.0080.01911.61
5.4.70.0090.01611.62
5.4.60.0040.02411.57
5.4.50.0060.02311.61
5.4.40.0040.02311.63
5.4.30.0050.02011.48
5.4.20.0070.01911.43
5.4.10.0060.01811.45
5.4.00.0090.01911.27
5.3.290.0040.02811.75
5.3.280.0040.02311.57
5.3.270.0060.02111.54
5.3.260.0060.02111.70
5.3.250.0040.02311.63
5.3.240.0020.02211.60
5.3.230.0070.02311.68
5.3.220.0060.02211.62
5.3.210.0040.02811.49
5.3.200.0040.02311.62
5.3.190.0070.02811.64
5.3.180.0100.01911.73
5.3.170.0060.02311.62
5.3.160.0080.02411.71
5.3.150.0070.02111.71
5.3.140.0080.02511.65
5.3.130.0050.02111.58
5.3.120.0060.02211.55
5.3.110.0060.02011.51
5.3.100.0040.02611.38
5.3.90.0070.01911.27
5.3.80.0100.01611.25
5.3.70.0030.02211.29
5.3.60.0020.02411.21
5.3.50.0040.02611.21
5.3.40.0060.02011.22
5.3.30.0040.02311.27
5.3.20.0030.02411.11
5.3.10.0100.02111.02
5.3.00.0080.02511.04
5.2.170.0070.0239.73
5.2.160.0070.0219.73
5.2.150.0040.0239.73
5.2.140.0040.0259.73
5.2.130.0050.0209.71
5.2.120.0060.0179.71
5.2.110.0050.0169.71
5.2.100.0060.0159.71
5.2.90.0040.0209.71
5.2.80.0050.0179.71
5.2.70.0040.0179.71
5.2.60.0020.0289.69
5.2.50.0030.0229.67
5.2.40.0040.0199.66
5.2.30.0090.0199.65
5.2.20.0040.0159.64
5.2.10.0050.0179.60
5.2.00.0040.0209.53
5.1.60.0020.0149.16
5.1.50.0020.0179.16
5.1.40.0040.0159.15
5.1.30.0030.0159.32
5.1.20.0070.0149.33
5.1.10.0030.0169.20
5.1.00.0070.0149.20
5.0.50.0040.0108.43
5.0.40.0030.0128.37
5.0.30.0020.0208.27
5.0.20.0050.0098.26
5.0.10.0030.0138.25
5.0.00.0050.0168.24
4.4.90.0020.0117.52
4.4.80.0030.0117.50
4.4.70.0020.0137.50
4.4.60.0010.0127.50
4.4.50.0030.0107.51
4.4.40.0020.0177.48
4.4.30.0020.0097.51
4.4.20.0010.0137.55
4.4.10.0020.0117.55
4.4.00.0030.0137.51
4.3.110.0020.0107.46
4.3.100.0040.0097.46
4.3.90.0010.0107.44
4.3.80.0020.0137.42
4.3.70.0030.0097.44
4.3.60.0030.0097.44
4.3.50.0010.0117.44
4.3.40.0040.0147.40
4.3.30.0030.0086.77
4.3.20.0020.0106.76
4.3.10.0010.0116.74
4.3.00.0050.00812.33

preferences:
49.5 ms | 401 KiB | 5 Q