3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( 'Test' => 1, 'OtherKey' => 2, ); $keyTranslation = array( 'OtherKey' => 'other_key', 'Test' => 'test', ); function test(&$arr, $keyTranslation) { foreach ($arr as $key => $value) { var_dump($arr); var_dump($keyTranslation[$key]); $arr[$keyTranslation[$key]] = $value; unset($arr[$key]); } } test($arr, $keyTranslation);

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.0170.00016.63
8.3.50.0110.00318.18
8.3.40.0140.00418.47
8.3.30.0030.01518.69
8.3.20.0040.00420.27
8.3.10.0050.00323.53
8.3.00.0060.00319.26
8.2.180.0130.01016.63
8.2.170.0090.00922.96
8.2.160.0030.01020.52
8.2.150.0000.00824.18
8.2.140.0000.00724.66
8.2.130.0080.00017.50
8.2.120.0050.00326.35
8.2.110.0080.00322.24
8.2.100.0040.00818.05
8.2.90.0050.00319.35
8.2.80.0000.00817.97
8.2.70.0040.00417.61
8.2.60.0080.00017.93
8.2.50.0060.00318.07
8.2.40.0030.00619.45
8.2.30.0000.00720.57
8.2.20.0030.00617.75
8.2.10.0060.00318.07
8.2.00.0000.00918.07
8.1.280.0090.00625.92
8.1.270.0040.00422.17
8.1.260.0080.00028.09
8.1.250.0050.00328.09
8.1.240.0040.00422.52
8.1.230.0040.00817.66
8.1.220.0040.00417.79
8.1.210.0030.00518.77
8.1.200.0030.00617.35
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0050.00318.65
8.1.160.0040.00421.90
8.1.150.0070.00018.93
8.1.140.0050.00319.59
8.1.130.0070.00017.68
8.1.120.0030.00417.44
8.1.110.0040.00417.46
8.1.100.0040.00417.41
8.1.90.0050.00217.40
8.1.80.0070.00017.35
8.1.70.0070.00017.29
8.1.60.0000.00917.48
8.1.50.0090.00017.59
8.1.40.0040.00417.51
8.1.30.0030.00517.55
8.1.20.0030.00617.62
8.1.10.0030.00517.55
8.1.00.0070.00017.47
8.0.300.0080.00018.77
8.0.290.0040.00416.58
8.0.280.0050.00318.36
8.0.270.0000.00617.27
8.0.260.0030.00317.22
8.0.250.0030.00316.83
8.0.240.0000.00716.79
8.0.230.0050.00216.84
8.0.220.0070.00016.92
8.0.210.0070.00016.91
8.0.200.0040.00416.94
8.0.190.0040.00416.98
8.0.180.0000.00816.89
8.0.170.0040.00416.81
8.0.160.0030.00316.83
8.0.150.0030.00316.83
8.0.140.0070.00016.85
8.0.130.0080.00013.31
8.0.120.0030.00616.87
8.0.110.0040.00416.88
8.0.100.0030.00516.75
8.0.90.0040.00416.77
8.0.80.0060.01216.95
8.0.70.0040.00416.86
8.0.60.0000.00716.91
8.0.50.0040.00416.89
8.0.30.0140.00716.99
8.0.20.0100.00917.40
8.0.10.0070.00017.02
8.0.00.0080.00916.74
7.4.330.0050.00016.81
7.4.320.0000.00716.65
7.4.300.0000.00616.59
7.4.290.0040.00416.43
7.4.280.0070.00016.51
7.4.270.0000.00716.52
7.4.260.0000.00716.51
7.4.250.0000.00816.46
7.4.240.0020.00516.59
7.4.230.0000.00716.71
7.4.220.0170.00316.64
7.4.210.0090.00516.66
7.4.200.0000.00716.63
7.4.160.0130.00316.43
7.4.150.0100.00717.40
7.4.140.0140.01017.86
7.4.130.0080.00916.58
7.4.120.0090.01016.66
7.4.110.0110.00616.47
7.4.100.0090.01216.40
7.4.90.0090.00916.58
7.4.80.0100.00719.39
7.4.70.0100.00716.61
7.4.60.0060.00916.50
7.4.50.0070.01116.53
7.4.40.0100.00616.65
7.4.30.0100.01016.58
7.4.00.0130.00315.04
7.3.330.0020.00213.38
7.3.320.0020.00213.15
7.3.310.0030.00316.42
7.3.300.0030.00316.25
7.3.290.0030.00316.38
7.3.280.0110.00616.38
7.3.270.0140.00317.40
7.3.260.0130.00916.64
7.3.250.0070.00916.32
7.3.240.0090.01216.27
7.3.230.0200.00016.56
7.3.210.0140.00716.27
7.3.200.0050.01316.39
7.3.190.0090.01316.45
7.3.180.0040.01316.46
7.3.170.0030.01416.38
7.3.160.0090.00616.35
7.3.120.0070.01014.62
7.3.110.0030.00914.45
7.3.100.0090.00914.53
7.3.90.0060.00614.63
7.3.80.0030.01014.86
7.3.70.0090.00614.94
7.3.60.0070.00714.74
7.3.50.0030.01414.59
7.3.40.0060.00614.81
7.3.30.0040.01214.66
7.3.20.0030.01116.42
7.3.10.0100.00716.73
7.3.00.0060.00816.74
7.2.330.0170.00016.52
7.2.320.0140.00916.65
7.2.310.0030.01216.52
7.2.300.0060.01216.78
7.2.290.0000.01816.72
7.2.240.0090.00915.04
7.2.230.0000.01415.05
7.2.220.0120.00615.00
7.2.210.0060.00615.24
7.2.200.0030.01015.11
7.2.190.0030.01314.83
7.2.180.0090.00015.14
7.2.170.0100.00615.04
7.2.160.0000.01115.18
7.2.150.0030.00916.93
7.2.140.0090.00316.89
7.2.130.0060.00917.00
7.2.120.0030.01316.77
7.2.110.0060.00916.78
7.2.100.0000.01316.93
7.2.90.0070.00716.71
7.2.80.0070.00717.02
7.2.70.0030.01317.10
7.2.60.0080.00616.90
7.2.50.0130.00317.08
7.2.40.0070.01017.02
7.2.30.0040.01116.95
7.2.20.0100.00716.96
7.2.10.0040.00816.95
7.2.00.0080.00618.25
7.1.330.0030.01415.62
7.1.320.0000.01215.98
7.1.310.0030.01015.92
7.1.300.0110.00415.82
7.1.290.0090.00615.58
7.1.280.0070.01015.67
7.1.270.0090.00615.81
7.1.260.0040.01115.98
7.1.250.0090.00615.83
7.1.200.0120.00016.00
7.1.100.0040.00418.37
7.1.70.0030.00617.04
7.1.60.0100.01419.48
7.1.50.0100.00716.93
7.1.00.0070.07322.54
7.0.200.0240.00314.85
7.0.60.0000.04719.88
7.0.50.0000.05717.83
7.0.40.0070.04020.24
7.0.30.0230.07320.08
7.0.20.0300.08020.11
7.0.10.0130.08020.10
7.0.00.0070.09020.12
5.6.280.0000.06021.09
5.6.210.0100.06720.63
5.6.200.0030.04018.28
5.6.190.0170.07320.33
5.6.180.0270.06020.61
5.6.170.0270.06720.46
5.6.160.0170.07320.56
5.6.150.0070.08018.19
5.6.140.0030.05018.18
5.6.130.0030.08018.20
5.6.120.0200.07021.02
5.6.110.0100.08021.02
5.6.100.0070.06721.01
5.6.90.0170.07321.11
5.6.80.0070.08720.43
5.5.350.4130.04720.46
5.5.340.0000.04317.98
5.5.330.0130.06720.38
5.5.320.0030.08020.36
5.5.310.0330.06720.37
5.5.300.0000.07017.96
5.5.290.0130.07017.97
5.5.280.0000.05020.98
5.5.270.0130.08020.87
5.5.260.0130.07320.84
5.5.250.0070.04020.66
5.5.240.0200.06020.26

preferences:
37.26 ms | 400 KiB | 5 Q