3v4l.org

run code in 300+ PHP versions simultaneously
<?php function remap($e) { $elements = array( 1 => 'first_name', 2 => 'city', 3 => 'email', 4 => 'phone' ); $key = isset($elements[$e['element_id']]) ? $elements[$e['element_id']]: 'unknown'; return array($key => $e['value']); } $input[] = array('entry_id' => 33, 'element_id' => 1, 'value' => 'Fred'); $input[] = array('entry_id' => 33, 'element_id' => 2, 'value' => 'Phoenix'); $input[] = array('entry_id' => 33, 'element_id' => 3, 'value' => 'fred@test.com'); $input[] = array('entry_id' => 33, 'element_id' => 99, 'value' => 'Something else entirely'); $output = array(); foreach(array_map('remap', $input, $elements) as $key => $value) { $output[$key] = $value; }; var_dump($output);

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.0000.01518.43
8.3.50.0150.00318.31
8.3.40.0150.00618.97
8.3.30.0060.00918.79
8.3.20.0000.00821.77
8.3.10.0080.00023.49
8.3.00.0060.00321.20
8.2.180.0160.00616.45
8.2.170.0110.00422.96
8.2.160.0060.00922.15
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00420.51
8.2.120.0000.00726.35
8.2.110.0030.00619.30
8.2.100.0040.00717.97
8.2.90.0040.00418.16
8.2.80.0040.00418.02
8.2.70.0040.00417.78
8.2.60.0040.00417.63
8.2.50.0050.00318.16
8.2.40.0000.00822.28
8.2.30.0000.00719.32
8.2.20.0000.00718.00
8.2.10.0000.00717.63
8.2.00.0000.00818.00
8.1.280.0070.01125.92
8.1.270.0080.00023.86
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0000.01121.96
8.1.230.0110.00020.87
8.1.220.0050.00317.74
8.1.210.0080.00018.77
8.1.200.0040.00417.23
8.1.190.0080.00017.23
8.1.180.0000.00818.10
8.1.170.0000.00818.53
8.1.160.0000.00718.79
8.1.150.0070.00020.32
8.1.140.0070.00017.63
8.1.130.0000.00818.93
8.1.120.0070.00017.32
8.1.110.0000.00717.38
8.1.100.0040.00417.29
8.1.90.0070.00317.45
8.1.80.0000.00717.41
8.1.70.0080.00017.45
8.1.60.0080.00417.43
8.1.50.0080.00017.47
8.1.40.0050.00317.43
8.1.30.0040.00417.68
8.1.20.0000.00817.62
8.1.10.0000.00817.61
8.1.00.0020.01017.56
8.0.300.0070.00019.91
8.0.290.0080.00016.75
8.0.280.0070.00018.39
8.0.270.0000.00717.19
8.0.260.0040.00416.83
8.0.250.0000.00617.01
8.0.240.0000.00716.95
8.0.230.0030.00316.94
8.0.220.0000.00716.95
8.0.210.0040.00416.91
8.0.200.0080.00016.85
8.0.190.0000.00716.97
8.0.180.0050.00216.92
8.0.170.0000.00916.93
8.0.160.0040.00416.96
8.0.150.0040.00416.85
8.0.140.0080.00016.75
8.0.130.0050.00013.29
8.0.120.0050.00316.75
8.0.110.0070.00016.79
8.0.100.0070.00016.80
8.0.90.0000.00716.93
8.0.80.0030.01716.92
8.0.70.0050.00216.72
8.0.60.0040.00416.73
8.0.50.0040.00416.79
8.0.30.0100.00817.06
8.0.20.0170.00217.40
8.0.10.0070.00017.04
8.0.00.0120.00916.71
7.4.330.0030.00315.55
7.4.320.0000.00616.62
7.4.300.0000.00616.66
7.4.290.0000.00816.52
7.4.280.0040.00416.51
7.4.270.0060.00316.41
7.4.260.0070.00016.48
7.4.250.0030.00316.39
7.4.240.0000.00816.60
7.4.230.0050.00216.32
7.4.220.0080.00016.61
7.4.210.0030.01216.55
7.4.200.0000.00816.51
7.4.160.0110.00716.46
7.4.140.0100.01017.86
7.4.130.0060.01216.48
7.4.120.0120.00616.58
7.4.110.0070.01016.54
7.4.100.0140.00316.62
7.4.90.0070.01016.40
7.4.80.0000.01719.39
7.4.70.0120.00616.42
7.4.60.0120.00616.51
7.4.50.0060.01016.39
7.4.40.0130.00316.21
7.4.00.0040.01115.04
7.3.330.0020.00213.16
7.3.320.0060.00013.16
7.3.310.0030.00316.30
7.3.300.0060.00016.17
7.3.290.0060.00916.31
7.3.280.0110.00816.30
7.3.260.0100.00916.51
7.3.250.0120.00516.31
7.3.240.0050.01316.38
7.3.230.0060.01116.18
7.3.210.0100.00716.37
7.3.200.0120.00416.62
7.3.190.0150.00016.43
7.3.180.0060.00916.34
7.3.170.0100.00716.40
7.3.160.0130.00316.32
7.2.330.0090.00916.58
7.2.320.0100.01116.53
7.2.310.0030.01516.66
7.2.300.0060.01216.44
7.2.290.0080.01116.47
7.2.60.0090.00016.63
7.2.30.0300.01617.91
7.2.20.0180.01917.94
7.2.10.0290.01317.85
7.2.00.0150.01417.45
7.1.200.0090.00315.71
7.1.150.0190.01016.52
7.1.140.0220.01216.77
7.1.130.0340.01116.82
7.1.120.0200.01116.95
7.1.110.0250.01016.37
7.1.100.0200.00516.13
7.1.90.0100.01215.96
7.1.80.0130.01015.70
7.1.70.0120.00815.31
7.1.60.0350.01633.37
7.1.50.0290.01232.86
7.1.40.0370.01832.72
7.1.30.0320.01632.57
7.1.20.0350.02132.67
7.1.10.0130.01314.63
7.1.00.0160.01314.84

preferences:
66.62 ms | 400 KiB | 5 Q