3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Original snippet // https://www.strangebuzz.com/en/snippets/modifying-array-values-with-array-map-and-an-anonymous-function $array = [ 'kikoo' => 'cat', 'foo' => 'bar', ]; $array1 = array_map(function ($value) { return $value.$value; }, $array); // for simple cases, pass the PHP function name directly $array2 = array_map('strtoupper', $array); print_r($array1); print_r($array2);

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.0080.00019.72
8.4.10.0130.00617.69
8.3.150.0000.00817.01
8.3.140.0150.00416.48
8.3.130.0030.00618.28
8.3.120.0030.01619.16
8.3.110.0030.00620.94
8.3.100.0030.00518.35
8.3.90.0080.00026.77
8.3.80.0090.00016.50
8.3.70.0140.00416.58
8.3.60.0140.00718.43
8.3.50.0090.00424.51
8.3.40.0070.01418.59
8.3.30.0110.00318.54
8.3.20.0040.00422.53
8.3.10.0040.00420.32
8.3.00.0080.00022.39
8.2.270.0090.00917.07
8.2.260.0090.00916.55
8.2.250.0000.01018.20
8.2.240.0050.00318.79
8.2.230.0050.00522.58
8.2.220.0060.00624.06
8.2.210.0070.00726.77
8.2.200.0030.00616.50
8.2.190.0120.00316.75
8.2.180.0180.00025.92
8.2.170.0100.01022.96
8.2.160.0070.00722.11
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00419.03
8.2.110.0030.00621.18
8.2.100.0060.00917.78
8.2.90.0000.00819.27
8.2.80.0060.00317.97
8.2.70.0000.00917.38
8.2.60.0050.00317.89
8.2.50.0050.00318.07
8.2.40.0040.00419.82
8.2.30.0040.00418.14
8.2.20.0050.00318.02
8.2.10.0050.00219.35
8.2.00.0070.00019.38
8.1.310.0040.00417.94
8.1.300.0060.00320.29
8.1.290.0060.00330.84
8.1.280.0070.01025.92
8.1.270.0000.00822.55
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0060.00321.37
8.1.230.0110.00019.00
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0070.00317.35
8.1.180.0040.00418.10
8.1.170.0050.00318.75
8.1.160.0070.00018.81
8.1.150.0040.00418.89
8.1.140.0000.00722.07
8.1.130.0040.00417.38
8.1.120.0040.00417.54
8.1.110.0000.00817.49
8.1.100.0040.00417.42
8.1.90.0040.00417.46
8.1.80.0040.00417.49
8.1.70.0000.00817.52
8.1.60.0040.00417.50
8.1.50.0080.00017.44
8.1.40.0000.00817.51
8.1.30.0000.00817.64
8.1.20.0000.00717.60
8.1.10.0060.00317.50
8.1.00.0080.00017.39
8.0.300.0080.00818.77
8.0.290.0070.00316.63
8.0.280.0000.00718.33
8.0.270.0000.00917.26
8.0.260.0030.00316.93
8.0.250.0070.00016.83
8.0.240.0030.00316.80
8.0.230.0080.00316.79
8.0.220.0070.00016.95
8.0.210.0070.00016.96
8.0.200.0000.00616.85
8.0.190.0070.00016.88
8.0.180.0080.00016.91
8.0.170.0000.00916.97
8.0.160.0000.00716.84
8.0.150.0030.00616.80
8.0.140.0040.00416.86
8.0.130.0030.00313.34
8.0.120.0040.00416.79
8.0.110.0030.00516.89
8.0.100.0000.00716.71
8.0.90.0040.00416.71
8.0.80.0030.01716.85
8.0.70.0170.01416.96
8.0.60.0220.00716.82
8.0.50.0160.01116.73
8.0.30.0170.00616.86
8.0.20.0120.00917.07
8.0.10.0180.00616.96
8.0.00.0100.00917.06
7.4.330.0030.00315.55
7.4.320.0060.00016.62
7.4.300.0030.00316.47
7.4.290.0040.00416.53
7.4.280.0030.00416.55
7.4.270.0000.00916.51
7.4.260.0030.00313.28
7.4.250.0000.00716.48
7.4.240.0040.00416.44
7.4.230.0000.00716.54
7.4.220.0000.00716.40
7.4.210.0190.00516.53
7.4.200.0240.00916.61
7.4.190.0160.00816.67
7.4.180.0100.01316.75
7.4.160.0120.00816.55
7.4.150.0140.00616.47
7.4.140.0130.00616.22
7.4.130.0120.00816.47
7.4.120.0080.01016.51
7.4.110.0090.01216.50
7.4.100.0100.00916.55
7.4.90.0110.01016.47
7.4.80.0140.00717.53
7.4.70.0160.00616.45
7.4.60.0130.00616.39
7.4.50.0120.00916.47
7.4.40.0130.00916.47
7.4.30.0130.00716.36
7.4.20.0170.00616.49
7.4.10.0130.00816.52
7.4.00.0110.00815.32
7.3.330.0050.00316.11
7.3.320.0030.00313.25
7.3.310.0070.00016.36
7.3.300.0020.00516.18
7.3.290.0220.00316.28
7.3.280.0130.00816.24
7.3.270.0100.01216.44
7.3.260.0120.01016.37
7.3.250.0130.01216.18
7.3.240.0110.00916.41
7.3.230.0130.01016.28
7.3.220.0120.00916.26
7.3.210.0130.00916.23
7.3.200.0110.00916.34
7.3.190.0150.00716.26
7.3.180.0130.00716.25
7.3.170.0170.00416.29
7.3.160.0140.00816.31
7.3.150.0110.01116.33
7.3.140.0100.01216.29
7.3.130.0110.01316.24
7.3.120.0130.00515.28
7.3.110.0100.00915.31
7.3.100.0100.00915.12
7.3.90.0090.00915.24
7.3.80.0110.00715.20
7.3.70.0080.01015.27
7.3.60.0110.00615.28
7.3.50.0100.00915.29
7.3.40.0050.01215.17
7.3.30.0090.00915.14
7.3.20.0100.00615.53
7.3.10.0080.00815.52
7.3.00.0100.00915.56
7.2.340.0210.00916.42
7.2.330.0210.00916.43
7.2.320.0170.01016.44
7.2.310.0170.01016.44
7.2.300.0140.01016.42
7.2.290.0120.01116.43
7.2.280.0170.01316.42
7.2.270.0180.01616.29
7.2.260.0190.01216.45
7.2.250.0130.00815.38
7.2.240.0100.01315.26
7.2.230.0110.01115.28
7.2.220.0120.00615.46
7.2.210.0120.00715.34
7.2.200.0110.01015.35
7.2.190.0140.00815.41
7.2.180.0120.00815.34
7.2.170.0120.00815.47
7.2.160.0180.01016.48
7.2.150.0160.01216.55
7.2.140.0190.01016.48
7.2.130.0200.00916.62
7.2.120.0290.00516.59
7.2.110.0230.00816.58
7.2.100.0230.01016.60
7.2.90.0200.01516.61
7.2.80.0250.00816.62
7.2.70.0230.01016.58
7.2.60.0210.01616.49
7.2.50.0180.01216.60
7.2.40.0210.00816.49
7.2.30.0230.01116.55
7.2.20.0270.01016.53
7.2.10.0190.01216.46
7.2.00.0230.00616.53

preferences:
26.69 ms | 403 KiB | 5 Q