3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 'index1' => 'Deleted', 'index2' => 'numbers', 'index3' => 'test', 'index4' => 'Inserted', ); $i=0; $specificIndex = array('index3','index2') ; $array1=array(); if(key($array)==$specificIndex[$i]){ $array1[$key] = $value; unset($array[$specificIndex[$i]]); $i++; } print_r($specificIndex); print_r($array); print_r($array1);

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.40.0000.01418.56
8.3.30.0040.01119.08
8.3.20.0070.00020.17
8.3.10.0040.00423.71
8.3.00.0080.00019.56
8.2.170.0090.00618.79
8.2.160.0030.01022.96
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0000.00726.16
8.2.120.0040.00419.36
8.2.110.0100.00020.35
8.2.100.0000.01218.16
8.2.90.0030.00519.23
8.2.80.0050.00317.97
8.2.70.0040.00417.63
8.2.60.0030.00617.93
8.2.50.0080.00018.07
8.2.40.0080.00418.09
8.2.30.0000.00717.92
8.2.20.0000.00717.73
8.2.10.0000.00817.88
8.2.00.0020.00517.88
8.1.270.0030.00620.38
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0000.00823.91
8.1.230.0070.00319.09
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0030.00717.23
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0050.00318.66
8.1.160.0040.00422.03
8.1.150.0000.00818.90
8.1.140.0040.00417.33
8.1.130.0030.00317.84
8.1.120.0040.00417.46
8.1.110.0000.00817.46
8.1.100.0030.00317.35
8.1.90.0000.00717.49
8.1.80.0030.00517.34
8.1.70.0030.00317.47
8.1.60.0030.00617.46
8.1.50.0000.00817.50
8.1.40.0000.00717.54
8.1.30.0030.00517.67
8.1.20.0000.01017.56
8.1.10.0050.00217.37
8.1.00.0000.00817.43
8.0.300.0000.00718.77
8.0.290.0030.00516.63
8.0.280.0000.00718.43
8.0.270.0020.00517.21
8.0.260.0030.00317.11
8.0.250.0060.00016.92
8.0.240.0030.00516.95
8.0.230.0030.00316.79
8.0.220.0050.00216.82
8.0.210.0040.00416.74
8.0.200.0060.00016.77
8.0.190.0070.00016.90
8.0.180.0000.00716.89
8.0.170.0040.00416.76
8.0.160.0030.00516.83
8.0.150.0000.00816.63
8.0.140.0050.00316.79
8.0.130.0000.00613.22
8.0.120.0040.00416.80
8.0.110.0070.00016.73
8.0.100.0040.00416.89
8.0.90.0050.00216.81
8.0.80.0130.00316.85
8.0.70.0040.00416.89
8.0.60.0040.00416.95
8.0.50.0000.00716.78
8.0.30.0110.01016.91
8.0.20.0130.00617.40
8.0.10.0040.00417.13
8.0.00.0060.01016.70
7.4.330.0020.00215.21
7.4.320.0030.00316.55
7.4.300.0000.00716.52
7.4.290.0030.00316.55
7.4.280.0050.00516.35
7.4.270.0030.00316.52
7.4.260.0000.00716.61
7.4.250.0050.00316.48
7.4.240.0050.00316.59
7.4.230.0020.00516.59
7.4.220.0140.00716.54
7.4.210.0090.00616.59
7.4.200.0000.00716.48
7.4.160.0160.00716.46
7.4.150.0150.00317.40
7.4.140.0070.01417.86
7.4.130.0140.00616.42
7.4.120.0090.01316.42
7.4.110.0110.00716.63
7.4.100.0100.01016.65
7.4.90.0130.00616.58
7.4.80.0080.00819.39
7.4.70.0000.01516.49
7.4.60.0090.00616.55
7.4.50.0040.00016.30
7.4.40.0110.00616.60
7.4.30.0090.01216.44
7.4.00.0040.00814.71
7.3.330.0060.00012.96
7.3.320.0000.00613.05
7.3.310.0070.00016.24
7.3.300.0030.00316.23
7.3.290.0110.00916.21
7.3.280.0040.01116.22
7.3.270.0210.00417.40
7.3.260.0040.01416.37
7.3.250.0110.00616.39
7.3.240.0120.01216.41
7.3.230.0100.01416.52
7.3.210.0080.01116.48
7.3.200.0100.01316.42
7.3.190.0000.01816.30
7.3.180.0100.00616.37
7.3.170.0110.01116.36
7.3.160.0110.00516.28
7.3.10.0110.00816.47
7.3.00.0050.00916.26
7.2.330.0120.00616.66
7.2.320.0120.00616.61
7.2.310.0090.00616.66
7.2.300.0000.02116.43
7.2.290.0060.01616.70
7.2.130.0050.00716.66
7.2.120.0090.00616.69
7.2.110.0080.01016.77
7.2.100.0070.00516.61
7.2.90.0120.00616.45
7.2.80.0150.00416.48
7.2.70.0090.00716.54
7.2.60.0120.00716.57
7.2.50.0080.00716.71
7.2.40.0170.00616.62
7.2.30.0140.00316.80
7.2.20.0080.00516.41
7.2.10.0200.00816.64
7.2.00.0100.00817.46
7.1.250.0020.00915.41
7.1.100.0000.00917.97
7.1.70.0080.00816.73
7.1.60.0030.01017.31
7.1.50.0100.01616.76
7.1.00.0000.08022.35
7.0.200.0070.00716.88
7.0.60.0030.09020.05
7.0.50.0100.06317.88
7.0.40.0130.06320.15
7.0.30.0500.07720.17
7.0.20.0230.05320.16
7.0.10.0070.04020.09
7.0.00.0000.09720.16
5.6.280.0030.07320.78
5.6.210.0130.06020.50
5.6.200.0070.06018.18
5.6.190.0130.03320.45
5.6.180.0500.07020.57
5.6.170.0270.08020.45
5.6.160.0070.05320.50
5.6.150.0100.07718.18
5.6.140.0030.04018.23
5.6.130.0100.07718.19
5.6.120.0100.05321.00
5.6.110.0070.05721.12
5.6.100.0000.08720.98
5.6.90.0100.05020.88
5.6.80.0100.04720.40
5.5.350.0270.08020.49
5.5.340.0000.07717.94
5.5.330.0100.06720.25
5.5.320.0230.05020.32
5.5.310.0270.08020.36
5.5.300.0070.06318.07
5.5.290.0000.04317.95
5.5.280.0100.08020.75
5.5.270.0030.05720.86
5.5.260.0130.07020.75
5.5.250.0170.07320.65
5.5.240.0070.07720.35
5.4.450.0530.06019.07
5.4.440.0500.06019.19
5.4.430.0030.06019.52
5.4.420.0100.05719.52
5.4.410.0130.06319.30
5.4.400.0200.04319.22
5.4.390.0070.05719.06
5.4.380.0170.05019.02
5.4.370.0200.04719.15
5.4.360.0170.05019.13
5.4.350.0170.05019.15
5.4.340.0030.06018.98
5.4.320.0070.06319.25
5.4.310.0030.06019.25
5.4.300.0070.05719.15
5.4.290.0100.06319.26
5.4.280.0030.06019.10
5.4.270.0170.04719.03
5.4.260.0130.05319.14
5.4.250.0100.05319.15
5.4.240.0130.05319.00
5.4.230.0070.06019.00
5.4.220.0100.05719.04
5.4.210.0170.05319.00
5.4.200.0000.06316.86
5.4.190.0130.05019.10
5.4.180.0200.04719.13
5.4.170.0070.05719.19
5.4.160.0030.05719.08
5.4.150.0170.05019.08
5.4.140.0070.05716.25
5.4.130.0100.05716.63
5.4.120.0100.05016.49
5.4.110.0170.04316.57
5.4.100.0070.05316.47
5.4.90.0100.05016.24
5.4.80.0030.05316.46
5.4.70.0070.05316.25
5.4.60.0070.05316.33
5.4.50.0100.05016.44
5.4.40.0030.05716.21
5.4.30.0170.04316.21
5.4.20.0070.05716.44
5.4.10.0030.05716.37
5.4.00.0130.04315.89
5.3.290.0200.04714.66
5.3.280.0070.05314.51
5.3.270.0070.05714.55
5.3.260.0100.05714.47
5.3.250.0100.05314.58
5.3.240.0100.05314.50
5.3.230.0170.04314.62
5.3.220.0130.05714.67
5.3.210.0030.06014.49
5.3.200.0070.06014.67
5.3.190.0070.05314.63
5.3.180.0070.06014.46
5.3.170.0170.06014.57
5.3.160.0100.06014.63
5.3.150.0170.06314.41
5.3.140.0100.07014.57
5.3.130.0200.04314.60
5.3.120.0100.07314.69
5.3.110.0170.06714.50
5.3.100.0100.05014.09
5.3.90.0100.06014.02
5.3.80.0100.05013.94
5.3.70.0100.05314.00
5.3.60.0070.05314.06
5.3.50.0030.05713.85
5.3.40.0070.05714.05
5.3.30.0000.05713.91
5.3.20.0230.03313.71
5.3.10.0170.04013.80
5.3.00.0100.05013.59
5.2.170.0130.03711.09
5.2.160.0030.04311.11
5.2.150.0130.03711.15
5.2.140.0070.04311.12
5.2.130.0000.04711.05
5.2.120.0100.05011.09
5.2.110.0030.04310.95
5.2.100.0130.03711.17
5.2.90.0100.04011.01
5.2.80.0030.04310.96
5.2.70.0130.03311.00
5.2.60.0030.04311.21
5.2.50.0000.04711.09
5.2.40.0070.04010.95
5.2.30.0100.03710.95
5.2.20.0130.03310.86
5.2.10.0030.04010.84
5.2.00.0130.03310.70
5.1.60.0130.0239.86
5.1.50.0100.03010.06
5.1.40.0070.0339.91
5.1.30.0100.03310.31
5.1.20.0000.04710.20
5.1.10.0100.03310.14
5.1.00.0070.03310.05
5.0.50.0030.0308.63
5.0.40.0030.0308.44
5.0.30.0100.0378.14
5.0.20.0070.0278.30
5.0.10.0000.0378.30
5.0.00.0070.0478.08
4.4.90.0000.0275.75
4.4.80.0070.0175.73
4.4.70.0070.0205.84
4.4.60.0000.0275.73
4.4.50.0030.0275.80
4.4.40.0000.0375.79
4.4.30.0070.0205.76
4.4.20.0100.0175.79
4.4.10.0000.0235.91
4.4.00.0070.0335.88
4.3.110.0070.0205.72
4.3.100.0000.0235.79
4.3.90.0000.0235.70
4.3.80.0000.0375.76
4.3.70.0070.0175.73
4.3.60.0030.0205.64
4.3.50.0030.0205.84
4.3.40.0030.0335.73
4.3.30.0030.0234.49
4.3.20.0000.0234.39
4.3.10.0000.0234.36
4.3.00.0130.0207.00

preferences:
51.2 ms | 400 KiB | 5 Q