3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 'index1' => 'Deleted', 'index2' => 'numbers', 'index3' => 'test', 'index4' => 'Inserted', ); $specificIndex = array('index3','index2'); $array1=array(); foreach($array as $key => $value){ if($key==$specificIndex){ $array1[$key] = $value; unset($array($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)
5.6.100.0070.07020.99
5.6.90.0070.08721.00
5.6.80.0070.04020.43
5.5.260.0130.08320.96
5.5.250.0130.08020.79
5.5.240.0030.07020.28
5.4.420.0100.07719.31
5.4.410.0170.05719.33
5.4.400.0170.04719.14
5.4.390.0100.05319.06
5.4.380.0130.05019.16
5.4.370.0100.05318.97
5.4.360.0070.06719.07
5.4.350.0100.05318.99
5.4.340.0030.05719.13
5.4.320.0100.05718.95
5.4.310.0170.04318.99
5.4.300.0270.03719.05
5.4.290.0030.06319.05
5.4.280.0130.04718.95
5.4.270.0070.05318.95
5.4.260.0100.05319.10
5.4.250.0200.04718.95
5.4.240.0100.05319.14
5.4.230.0130.04719.11
5.4.220.0130.05019.10
5.4.210.0070.05318.95
5.4.200.0100.05016.75
5.4.190.0170.04719.03
5.4.180.0200.04719.04
5.4.170.0030.06019.24
5.4.160.0130.04719.04
5.4.150.0100.05718.89
5.4.140.0170.04716.53
5.4.130.0170.04316.18
5.4.120.0070.05316.34
5.4.110.0070.05016.59
5.4.100.0100.05016.42
5.4.90.0100.05016.52
5.4.80.0030.05316.50
5.4.70.0030.05716.10
5.4.60.0030.05316.51
5.4.50.0100.04716.15
5.4.40.0170.04316.53
5.4.30.0100.04716.19
5.4.20.0000.05716.48
5.4.10.0070.05016.34
5.4.00.0100.04715.97
5.3.290.0030.06014.45
5.3.280.0100.05014.44
5.3.270.0000.06314.49
5.3.260.0170.05314.49
5.3.250.0070.05314.58
5.3.240.0100.06714.63
5.3.230.0100.05014.60
5.3.220.0100.04714.56
5.3.210.0100.05314.60
5.3.200.0100.05014.46
5.3.190.0130.06314.55
5.3.180.0100.05014.40
5.3.170.0100.05014.45
5.3.160.0030.05714.43
5.3.150.0100.05014.46
5.3.140.0000.06014.53
5.3.130.0130.05014.47
5.3.120.0130.05314.57
5.3.110.0000.06314.40
5.3.100.0130.04713.90
5.3.90.0130.04714.02
5.3.80.0030.05713.89
5.3.70.0230.04313.86
5.3.60.0030.06713.86
5.3.50.0170.04313.98
5.3.40.0170.04313.73
5.3.30.0200.03713.74
5.3.20.0100.05013.56
5.3.10.0070.05313.59
5.3.00.0170.04013.57
5.2.170.0030.04711.04
5.2.160.0030.04310.98
5.2.150.0070.06710.98
5.2.140.0070.04311.00
5.2.130.0100.03711.14
5.2.120.0170.03010.92
5.2.110.0030.04311.00
5.2.100.0130.04010.99
5.2.90.0130.05011.15
5.2.80.0070.04311.00
5.2.70.0100.04711.04
5.2.60.0000.05710.94
5.2.50.0030.04310.88
5.2.40.0000.04710.83
5.2.30.0130.03710.86
5.2.20.0070.03710.96
5.2.10.0070.03710.93
5.2.00.0100.03710.65
5.1.60.0030.0379.98
5.1.50.0070.0339.89
5.1.40.0000.0509.90
5.1.30.0100.03010.18
5.1.20.0070.03710.29
5.1.10.0070.04310.10
5.1.00.0030.04010.00
5.0.50.0130.0308.62
5.0.40.0030.0278.40
5.0.30.0030.0438.21
5.0.20.0030.0308.12
5.0.10.0030.0308.11
5.0.00.0030.0438.07
4.4.90.0030.0235.76
4.4.80.0000.0235.81
4.4.70.0000.0235.74
4.4.60.0000.0235.75
4.4.50.0030.0205.87
4.4.40.0030.0335.74
4.4.30.0070.0205.75
4.4.20.0100.0135.86
4.4.10.0030.0235.82
4.4.00.0030.0335.79
4.3.110.0000.0235.84
4.3.100.0000.0235.82
4.3.90.0030.0205.76
4.3.80.0100.0275.73
4.3.70.0070.0175.81
4.3.60.0030.0235.65
4.3.50.0030.0235.73
4.3.40.0030.0335.70
4.3.30.0030.0304.58
4.3.20.0030.0204.39
4.3.10.0070.0174.50
4.3.00.0030.0307.00

preferences:
155.84 ms | 997 KiB | 7 Q