3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = Array ( 0 => 'world', 1 => 'is', 2 => 'a', 3 => 'wonderfull', 5 => 'in', 6 => 'our' ); $new_array = []; $old_key = -1; $i = 0; foreach($arr as $key=>$val){ if(($key-$old_key) ==1){ $new_array[$i][] = $val; $old_key = $key; } if(($key-$old_key) >1){ $i++; $new_array[$i][] = $val; $old_key = $key; } } print_r($new_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.4.10.0000.00917.62
8.3.140.0100.01016.59
8.3.130.0050.00316.54
8.3.120.0050.00518.73
8.3.110.0030.00620.94
8.3.100.0060.00324.06
8.3.90.0060.01226.77
8.3.80.0000.01017.97
8.3.70.0140.00718.56
8.3.60.0090.00618.43
8.3.50.0100.01018.07
8.3.40.0110.00418.65
8.3.30.0130.00318.43
8.3.20.0040.00419.35
8.3.10.0060.00321.77
8.3.00.0030.00520.67
8.2.260.0100.00719.03
8.2.250.0050.00316.50
8.2.240.0000.00916.97
8.2.230.0030.00622.58
8.2.220.0000.00837.54
8.2.210.0130.00626.77
8.2.200.0060.00316.75
8.2.190.0040.01116.58
8.2.180.0110.00418.18
8.2.170.0070.00719.09
8.2.160.0070.01022.96
8.2.150.0050.00325.66
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0070.00021.20
8.2.110.0100.00021.11
8.2.100.0040.00717.84
8.2.90.0080.00018.22
8.2.80.0000.00720.36
8.2.70.0030.00618.03
8.2.60.0030.00518.09
8.2.50.0000.00918.10
8.2.40.0040.00419.42
8.2.30.0040.00419.37
8.2.20.0000.00718.03
8.2.10.0040.00418.19
8.2.00.0080.00017.71
8.1.300.0030.00617.95
8.1.290.0090.00018.88
8.1.280.0070.01025.92
8.1.270.0050.00224.66
8.1.260.0060.00326.35
8.1.250.0000.00728.09
8.1.240.0060.00322.19
8.1.230.0040.00820.87
8.1.220.0080.00017.74
8.1.210.0040.00418.97
8.1.200.0040.00817.35
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0060.00318.39
8.1.160.0000.00718.89
8.1.150.0040.00418.80
8.1.140.0030.00322.14
8.1.130.0000.00719.25
8.1.120.0000.00717.42
8.1.110.0030.00517.41
8.1.100.0040.00417.44
8.1.90.0040.00417.45
8.1.80.0040.00417.47
8.1.70.0000.00717.36
8.1.60.0000.00817.50
8.1.50.0080.00017.50
8.1.40.0030.00517.41
8.1.30.0060.00317.60
8.1.20.0060.00317.68
8.1.10.0000.00817.42
8.1.00.0000.00817.35
8.0.300.0000.00720.09
8.0.290.0040.00416.75
8.0.280.0030.00318.57
8.0.270.0030.00317.16
8.0.260.0030.00516.74
8.0.250.0040.00416.96
8.0.240.0040.00416.90
8.0.230.0000.00716.95
8.0.220.0030.00316.91
8.0.210.0040.00416.95
8.0.200.0030.00316.79
8.0.190.0050.00316.93
8.0.180.0080.00016.95
8.0.170.0000.00816.77
8.0.160.0040.00416.82
8.0.150.0030.00516.78
8.0.140.0030.00316.82
8.0.130.0050.00013.33
8.0.120.0040.00416.84
8.0.110.0000.00716.67
8.0.100.0000.00716.88
8.0.90.0000.00717.00
8.0.80.0080.00916.85
8.0.70.0000.00716.71
8.0.60.0040.00416.95
8.0.50.0050.00216.71
8.0.30.0120.01017.00
8.0.20.0100.00917.40
8.0.10.0000.00716.97
8.0.00.0100.00916.68
7.4.330.0020.00215.55
7.4.320.0000.00616.50
7.4.300.0000.00716.58
7.4.290.0040.00416.50
7.4.280.0030.00616.62
7.4.270.0040.00416.61
7.4.260.0090.00016.55
7.4.250.0040.00416.55
7.4.240.0000.00716.64
7.4.230.0000.00716.47
7.4.220.0030.00616.59
7.4.210.0080.00716.58
7.4.200.0070.00016.69
7.4.160.0070.01016.41
7.4.140.0140.00717.86
7.4.130.0130.00316.65
7.4.120.0090.00816.55
7.4.110.0140.00916.56
7.4.100.0090.00916.59
7.4.90.0090.00916.50
7.4.80.0100.01319.39
7.4.70.0090.00916.59
7.4.60.0060.01016.56
7.4.50.0070.00716.55
7.4.40.0060.01116.48
7.4.00.0040.01114.82
7.3.330.0000.00513.21
7.3.320.0030.00313.08
7.3.310.0000.00916.14
7.3.300.0030.00316.30
7.3.290.0030.00316.36
7.3.280.0080.00816.27
7.3.260.0110.00816.35
7.3.240.0060.01016.34
7.3.230.0140.01016.27
7.3.210.0140.00316.29
7.3.200.0110.00716.51
7.3.190.0060.01216.44
7.3.180.0160.00616.59
7.3.170.0070.01016.51
7.3.160.0100.00516.50
7.3.120.0050.01414.68
7.3.110.0110.00814.83
7.3.100.0130.00214.70
7.3.90.0030.00814.73
7.3.80.0090.00614.86
7.3.70.0050.00614.76
7.3.60.0050.00914.79
7.3.50.0070.00714.65
7.3.40.0060.00614.76
7.3.30.0050.00814.75
7.3.20.0100.00516.59
7.3.10.0070.00816.62
7.3.00.0070.00716.62
7.2.330.0110.00616.58
7.2.320.0030.01316.79
7.2.310.0060.00916.43
7.2.300.0030.01216.78
7.2.290.0030.01316.45
7.2.250.0090.00915.19
7.2.240.0060.01115.04
7.2.230.0070.00815.16
7.2.220.0050.01014.90
7.2.210.0070.00815.11
7.2.200.0060.00614.95
7.2.190.0040.01115.02
7.2.180.0080.00815.04
7.2.170.0040.01115.09
7.2.160.0040.01114.90
7.2.150.0000.01416.71
7.2.140.0040.01516.85
7.2.130.0060.00616.84
7.2.120.0030.00716.92
7.2.110.0390.01015.50
7.2.100.0100.00716.60
7.2.90.0100.00716.79
7.2.80.0090.00816.56
7.2.70.0060.01215.76
7.2.60.0320.00816.00
7.2.50.0310.00716.88
7.2.40.0290.01116.72
7.2.30.0320.01116.85
7.2.20.0110.00915.88
7.2.10.0120.00516.00
7.2.00.0280.00715.75
7.1.330.0050.01016.01
7.1.320.0080.01015.91
7.1.310.0090.00515.87
7.1.300.0050.01015.86
7.1.290.0030.00915.78
7.1.280.0050.00715.57
7.1.270.0060.00915.85
7.1.260.0100.00315.90
7.1.250.0000.00815.68
7.1.230.0770.01015.15
7.1.220.0100.00815.24
7.1.210.0090.00915.57
7.1.200.0000.01715.89
7.1.190.0100.00813.45
7.1.180.0070.00813.83
7.1.170.0580.00315.32
7.1.160.0680.00315.47
7.1.150.0480.00715.82
7.1.140.0140.00313.82
7.1.130.0470.01013.95
7.1.120.0450.01013.89
7.1.110.0470.00914.07
7.1.100.0430.01615.67
7.1.90.0530.00915.64
7.1.80.0180.00015.61
7.1.70.0460.01013.99
7.1.60.0960.01031.85
7.1.50.1440.01631.70
7.1.40.0750.00033.39
7.1.30.0930.01033.58
7.1.20.0170.02333.34
7.1.10.0110.00815.80
7.1.00.0130.00915.52
5.6.380.0070.01014.00

preferences:
52.64 ms | 403 KiB | 5 Q