3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testArray = ['a' => ['b' => 'l'], 'c' => 'm', 'd' => ['n' => 'o']]; $actionArray = ['b' => 'action']; function toUpperRecursive($arr, $actionArray) { foreach ($arr as $key => $val) { if (is_array($val)) { $newKey = strtoupper($key); $arr[$newKey] = toUpperRecursive($val, $actionArray); unset($arr[$key]); } elseif (is_string($val)) { foreach($actionArray as $actionKey => $action) { if($key === $actionKey) { $arr[$key] = $val . ' + 1111'; } } } } return $arr; } // echo "before:\n"; // var_export($testArray); // echo "after:\n"; // var_export(toUpperRecursive($testArray)); var_export(toUpperRecursive($testArray, $actionArray));

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.20.0140.00719.52
8.4.10.0130.00717.84
8.3.140.0040.00417.42
8.3.130.0040.00418.28
8.3.120.0090.00319.16
8.3.110.0030.01720.94
8.3.100.0030.00624.06
8.3.90.0080.00026.77
8.3.80.0060.00319.36
8.3.70.0100.01016.63
8.3.60.0120.00316.50
8.3.50.0100.00518.10
8.3.40.0070.00718.80
8.3.30.0070.00718.68
8.3.20.0040.00421.93
8.3.10.0080.00021.72
8.3.00.0090.00019.80
8.2.260.0120.00618.09
8.2.250.0190.00016.48
8.2.240.0120.00618.73
8.2.230.0030.00522.58
8.2.220.0040.00437.54
8.2.210.0080.00026.77
8.2.200.0060.00318.88
8.2.190.0070.01116.58
8.2.180.0090.00916.38
8.2.170.0140.00022.96
8.2.160.0100.00321.13
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0080.00020.89
8.2.110.0090.00019.18
8.2.100.0100.00017.84
8.2.90.0040.00418.22
8.2.80.0000.00817.97
8.2.70.0030.00517.63
8.2.60.0000.00818.16
8.2.50.0000.00918.07
8.2.40.0040.00418.34
8.2.30.0030.00618.13
8.2.20.0040.00418.17
8.2.10.0030.00518.11
8.2.00.0030.00618.18
8.1.310.0070.00718.02
8.1.300.0070.00317.61
8.1.290.0060.00330.84
8.1.280.0070.00725.92
8.1.270.0030.00523.96
8.1.260.0040.01126.35
8.1.250.0080.00028.09
8.1.240.0090.00021.22
8.1.230.0110.00020.99
8.1.220.0000.00917.74
8.1.210.0050.00318.89
8.1.200.0060.00317.38
8.1.190.0060.00317.23
8.1.180.0040.00418.10
8.1.170.0040.00418.50
8.1.160.0040.00418.93
8.1.150.0000.00718.98
8.1.140.0050.00217.66
8.1.130.0040.00418.89
8.1.120.0030.00717.46
8.1.110.0000.00917.49
8.1.100.0000.00817.45
8.1.90.0030.00617.52
8.1.80.0040.00417.44
8.1.70.0040.00417.48
8.1.60.0040.00417.51
8.1.50.0000.00817.55
8.1.40.0040.00417.52
8.1.30.0000.00917.61
8.1.20.0070.00017.66
8.1.10.0070.00017.61
8.1.00.0040.00417.55
8.0.300.0030.00620.04
8.0.290.0040.00416.58
8.0.280.0040.00420.23
8.0.270.0040.00416.82
8.0.260.0000.00617.25
8.0.250.0000.00716.96
8.0.240.0060.00316.96
8.0.230.0030.00316.96
8.0.220.0040.00416.83
8.0.210.0050.00216.91
8.0.200.0040.00416.93
8.0.190.0000.00716.93
8.0.180.0000.00716.84
8.0.170.0000.00816.92
8.0.160.0040.00416.89
8.0.150.0040.00716.80
8.0.140.0000.00716.80
8.0.130.0060.00013.36
8.0.120.0080.00016.74
8.0.110.0000.00716.86
8.0.100.0040.00416.93
8.0.90.0030.00316.77
8.0.80.0110.00416.94
8.0.70.0030.00316.77
8.0.60.0000.00716.75
8.0.50.0040.00416.88
8.0.30.0080.01217.11
8.0.20.0120.00817.40
8.0.10.0000.00716.98
8.0.00.0210.00116.84
7.4.330.0000.00616.69
7.4.320.0000.00616.46
7.4.300.0060.00016.61
7.4.290.0000.00716.52
7.4.280.0040.00416.39
7.4.270.0050.00216.46
7.4.260.0000.00716.49
7.4.250.0050.00316.37
7.4.240.0070.00016.52
7.4.230.0030.00316.49
7.4.220.0000.00716.61
7.4.210.0090.00616.54
7.4.200.0070.00016.25
7.4.160.0140.00516.54
7.4.140.0140.00917.86
7.4.130.0040.01416.49
7.4.120.0110.00716.56
7.4.110.0140.00816.50
7.4.100.0070.01016.47
7.4.90.0100.01316.56
7.4.80.0120.01219.39
7.4.70.0040.01116.33
7.4.60.0070.01016.47
7.4.50.0040.01216.39
7.4.40.0130.01016.43
7.4.10.0070.00714.88
7.4.00.0110.00514.83
7.3.330.0030.00313.22
7.3.320.0030.00313.20
7.3.310.0000.00716.39
7.3.300.0030.00316.33
7.3.290.0070.00016.41
7.3.280.0070.00716.37
7.3.260.0120.00616.53
7.3.240.0120.00516.42
7.3.230.0160.00816.32
7.3.210.0170.00716.39
7.3.200.0080.00816.29
7.3.190.0120.00316.29
7.3.180.0060.01016.43
7.3.170.0110.00716.48
7.3.160.0120.00416.56
7.3.130.0120.00314.90
7.3.120.0070.01014.51
7.3.110.0090.00914.79
7.3.100.0000.01414.58
7.3.90.0070.00715.00
7.3.80.0110.00314.94
7.3.70.0000.01614.79
7.3.60.0030.01014.74
7.3.50.0060.00614.88
7.3.40.0030.01014.99
7.3.30.0030.01014.78
7.3.20.0030.00716.80
7.3.10.0090.00316.49
7.3.00.0070.00716.75
7.2.330.0110.00916.47
7.2.320.0100.01016.88
7.2.310.0070.01316.73
7.2.300.0070.01116.46
7.2.290.0030.02116.52
7.2.260.0030.01015.19
7.2.250.0090.00915.27
7.2.240.0100.00714.93
7.2.230.0030.01414.81
7.2.220.0130.00614.97
7.2.210.0000.01414.94
7.2.200.0110.00315.12
7.2.190.0040.01115.19
7.2.180.0040.00715.23
7.2.170.0080.00614.90
7.2.160.0070.01014.89
7.2.150.0040.00817.08
7.2.140.0060.01017.00
7.2.130.0080.00817.02
7.2.120.0100.01016.98
7.2.110.0060.01116.74
7.2.100.0040.00816.93
7.2.90.0100.00716.79
7.2.80.0040.00816.97
7.2.70.0130.00316.89
7.2.60.0130.00116.78
7.2.50.0060.00916.84
7.2.40.0360.00817.41
7.2.30.0310.01317.50
7.2.20.0370.00717.50
7.2.10.0330.01017.37
7.2.00.0470.00917.51
7.1.330.0130.00315.79
7.1.320.0030.01015.92
7.1.310.0030.01015.90
7.1.300.0040.00815.72
7.1.290.0070.00715.95
7.1.280.0000.01116.00
7.1.270.0060.00916.01
7.1.260.0120.00015.79
7.1.250.0000.01015.86
7.1.240.0070.00715.61
7.1.230.0060.01215.95
7.1.220.0100.00015.91
7.1.210.0090.00615.64
7.1.200.0090.00515.78
7.1.190.0000.01215.63
7.1.180.0060.00315.96
7.1.170.0030.01215.79
7.1.160.0360.00716.22
7.1.150.0340.01016.31
7.1.140.0430.00716.21
7.1.130.0470.01216.48
7.1.120.0470.00916.33
7.1.110.0330.00516.13
7.1.100.0490.00816.20
7.1.90.0430.01215.95
7.1.80.0300.01215.99
7.1.70.0270.00915.63
7.1.60.0450.00824.44
7.1.50.0470.01424.30
7.1.40.1040.01024.03
7.1.30.0360.01124.27
7.1.20.0690.01324.23
7.1.10.0440.01115.44
7.1.00.0380.00915.28
7.0.330.0070.00815.23
7.0.320.0080.00315.49
7.0.310.0030.01315.60
7.0.300.0030.00915.53
7.0.290.0000.00815.35
7.0.280.0070.01015.55
7.0.270.0060.00615.44
7.0.260.0000.01615.55
7.0.250.0040.01115.27
7.0.240.0130.00315.47
7.0.230.0040.00715.41
7.0.220.0050.00515.40
7.0.210.0050.00315.39
7.0.200.0060.00915.54
7.0.190.0080.00615.31
7.0.180.0040.00415.42
7.0.170.0030.00715.50
7.0.160.0030.00615.50
7.0.150.0100.00315.22
7.0.140.0090.00315.51
7.0.130.0070.00715.43
7.0.120.0040.01115.34
7.0.110.0000.01215.57
7.0.100.0100.00315.44
7.0.90.0070.00315.52
7.0.80.0040.00715.51
7.0.70.0070.00715.46
7.0.60.0040.00815.43
7.0.50.0090.00615.23
7.0.40.0030.00913.57
7.0.30.0030.01013.51
7.0.20.0030.00913.30
7.0.10.0030.01013.15
7.0.00.0000.00813.56
5.6.400.0040.01113.96
5.6.390.0070.00714.37
5.6.380.0030.01014.43
5.6.370.0070.00714.57
5.6.360.0030.00914.30
5.6.350.0030.00913.91
5.6.340.0060.01014.67
5.6.330.0030.01014.02
5.6.320.0000.01014.36
5.6.310.0040.00814.42
5.6.300.0030.00514.48
5.6.290.0040.00414.69
5.6.280.0070.00314.11
5.6.270.0000.01314.59
5.6.260.0040.01114.57
5.6.250.0040.01114.46
5.6.240.0040.01114.48
5.6.230.0080.00414.32
5.6.220.0030.00914.26
5.6.210.0000.01314.45
5.6.200.0000.01514.47
5.6.190.0030.00514.56
5.6.180.0040.01214.50
5.6.170.0070.00714.50
5.6.160.0030.00614.27
5.6.150.0030.00614.22
5.6.140.0000.00814.33
5.6.130.0070.00714.63
5.6.120.0080.00814.30
5.6.110.0030.00614.64
5.6.100.0040.00414.59
5.6.90.0030.01014.64
5.6.80.0070.00414.23
5.6.70.0100.00714.69
5.6.60.0030.01014.34
5.6.50.0070.00714.30
5.6.40.0100.00314.53
5.6.30.0000.01414.27
5.6.20.0040.01214.48
5.6.10.0030.00714.32
5.6.00.0030.00914.69

preferences:
49.96 ms | 403 KiB | 5 Q