3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mapping = [ "AccountId" => "account_id", "Id" => "master_id", "Name" => "name" ]; $input = [ "AccountId" => "18", "Id" => "53600065", "Name" => "Awesome Test Company From SS", "Financial" => [ "vat" => "12345", ] ]; $output = []; foreach ($mapping as $from => $to) { if (array_key_exists($from, $input)) { $output[$to] = $input[$from]; } } 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.0120.00418.68
8.3.50.0150.00416.36
8.3.40.0070.00718.53
8.3.30.0110.00418.70
8.3.20.0050.00220.07
8.3.10.0040.00421.87
8.3.00.0050.00320.77
8.2.180.0100.00718.26
8.2.170.0100.00722.96
8.2.160.0070.00722.12
8.2.150.0070.00724.18
8.2.140.0060.00324.66
8.2.130.0040.00420.35
8.2.120.0050.00226.35
8.2.110.0030.00620.52
8.2.100.0090.00317.71
8.2.90.0050.00319.17
8.2.80.0050.00318.04
8.2.70.0030.00517.75
8.2.60.0120.00417.91
8.2.50.0050.00318.10
8.2.40.0080.00020.60
8.2.30.0030.00521.10
8.2.20.0070.00018.16
8.2.10.0040.00418.04
8.2.00.0000.00717.98
8.1.280.0110.00725.92
8.1.270.0070.00023.84
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0060.00322.08
8.1.230.0100.00318.93
8.1.220.0050.00317.74
8.1.210.0000.00918.77
8.1.200.0030.00717.48
8.1.190.0000.00917.23
8.1.180.0060.00318.10
8.1.170.0000.00818.64
8.1.160.0040.00419.02
8.1.150.0000.00818.79
8.1.140.0060.00319.60
8.1.130.0030.00318.78
8.1.120.0040.00417.42
8.1.110.0050.00317.35
8.1.100.0030.00617.45
8.1.90.0000.00717.44
8.1.80.0000.00717.30
8.1.70.0050.00317.35
8.1.60.0000.00817.55
8.1.50.0040.00417.34
8.1.40.0060.00317.58
8.1.30.0030.00517.69
8.1.20.0000.00917.54
8.1.10.0070.00017.54
8.1.00.0000.00717.32
8.0.300.0050.00319.85
8.0.290.0000.00716.63
8.0.280.0000.00718.38
8.0.270.0000.00716.70
8.0.260.0030.00316.76
8.0.250.0040.00417.01
8.0.240.0040.00416.72
8.0.230.0020.00516.97
8.0.220.0040.00416.90
8.0.210.0030.00316.72
8.0.200.0030.00316.96
8.0.190.0050.00316.91
8.0.180.0040.00716.98
8.0.170.0050.00316.86
8.0.160.0000.00816.94
8.0.150.0050.00216.91
8.0.140.0080.00016.73
8.0.130.0050.00313.19
8.0.120.0040.00416.87
8.0.110.0040.00416.71
8.0.100.0030.00516.67
8.0.90.0000.00716.75
8.0.80.0030.01216.86
8.0.70.0030.00616.75
8.0.60.0000.00716.83
8.0.50.0080.00016.91
8.0.30.0120.00817.00
8.0.20.0090.00917.40
8.0.10.0000.00816.93
8.0.00.0060.01716.80
7.4.330.0000.00415.55
7.4.320.0030.00316.51
7.4.300.0000.00716.47
7.4.290.0060.00316.34
7.4.280.0000.00716.57
7.4.270.0030.00316.51
7.4.260.0000.00616.49
7.4.250.0000.00716.56
7.4.240.0050.00216.48
7.4.230.0000.00716.58
7.4.220.0030.01516.39
7.4.210.0040.01116.53
7.4.200.0000.00716.60
7.4.160.0100.00916.55
7.4.150.0040.01517.40
7.4.140.0150.00717.86
7.4.130.0130.00616.72
7.4.120.0180.00416.42
7.4.110.0090.00916.54
7.4.100.0120.00516.50
7.4.90.0070.01116.39
7.4.80.0090.00819.39
7.4.70.0030.01316.69
7.4.60.0080.00816.48
7.4.50.0100.00616.68
7.4.40.0160.00016.40
7.4.30.0160.00016.52
7.4.10.0100.00715.24
7.4.00.0070.01114.85
7.3.330.0030.00313.06
7.3.320.0050.00013.04
7.3.310.0030.00316.29
7.3.300.0000.00616.19
7.3.290.0060.00816.32
7.3.280.0080.00916.32
7.3.270.0130.00317.40
7.3.260.0070.01416.57
7.3.250.0130.00616.42
7.3.240.0050.01116.40
7.3.230.0030.01516.29
7.3.210.0090.01116.44
7.3.200.0110.00616.23
7.3.190.0040.01116.32
7.3.180.0030.01616.48
7.3.170.0120.00316.29
7.3.160.0060.00916.43
7.3.130.0140.00314.89
7.3.120.0040.01415.13
7.3.110.0160.00314.77
7.3.100.0060.00914.86
7.3.90.0030.01615.01
7.3.80.0080.00314.93
7.3.70.0030.01014.59
7.3.60.0090.00614.96
7.3.50.0040.01214.52
7.3.40.0060.00614.88
7.3.30.0040.01214.99
7.3.20.0120.00316.40
7.3.10.0100.00316.73
7.3.00.0100.00316.41
7.2.330.0080.00816.79
7.2.320.0080.01516.68
7.2.310.0070.01016.64
7.2.300.0100.00716.55
7.2.290.0070.01016.70
7.2.260.0090.00615.13
7.2.250.0160.00014.86
7.2.240.0060.00915.23
7.2.230.0090.00914.95
7.2.220.0090.00614.98
7.2.210.0070.01014.89
7.2.200.0070.00715.14
7.2.190.0030.01015.12
7.2.180.0000.01815.04
7.2.170.0030.01214.92
7.2.160.0100.00614.84
7.2.150.0090.00016.69
7.2.140.0090.00617.06
7.2.130.0070.01016.85
7.2.120.0030.00716.90
7.2.110.0110.00316.76
7.2.100.0050.00916.86
7.2.90.0070.00516.78
7.2.80.0090.00716.86
7.2.70.0050.01116.79
7.2.60.0070.00816.91
7.2.50.0070.00516.85
7.2.40.0090.00616.90
7.2.30.0080.00616.86
7.2.20.0040.01117.06
7.2.10.0050.01016.90
7.2.00.0080.00817.84
7.1.330.0110.00416.10
7.1.320.0070.01015.86
7.1.310.0030.00615.89
7.1.300.0000.01115.87
7.1.290.0030.01315.95
7.1.280.0030.00715.50
7.1.270.0030.01015.96
7.1.260.0050.00515.61
7.1.250.0070.00715.71
7.1.240.0030.00715.75
7.1.230.0070.00515.83
7.1.220.0060.00615.69
7.1.210.0060.00815.89
7.1.200.0050.00815.78
7.1.190.0030.01015.87
7.1.180.0080.00615.77
7.1.170.0030.00815.95
7.1.160.0050.00615.80
7.1.150.0050.00715.76
7.1.140.0040.01015.84
7.1.130.0040.00915.90
7.1.120.0080.00615.71
7.1.110.0100.00515.95
7.1.100.0030.01216.62
7.1.90.0020.01015.73
7.1.80.0030.01215.67
7.1.70.0080.00516.28
7.1.60.0420.01021.72
7.1.50.0190.01121.44
7.1.40.0180.01121.34
7.1.30.0240.00921.36
7.1.20.0210.00921.48
7.1.10.0210.00515.48
7.1.00.0200.00515.61
7.0.330.0040.01115.43
7.0.320.0060.00515.31
7.0.310.0060.00515.41
7.0.300.0070.00315.29
7.0.290.0080.00515.30
7.0.280.0060.00715.13
7.0.270.0040.00815.23
7.0.260.0070.00715.49
7.0.250.0030.00915.36
7.0.240.0040.00815.45
7.0.230.0080.00515.33
7.0.220.0070.00515.27
7.0.210.0070.00715.42
7.0.200.0190.00915.28
7.0.190.0150.00815.12
7.0.180.0150.00814.98
7.0.170.0130.01215.00
7.0.160.0170.00615.15
7.0.150.0170.00715.16
7.0.140.0170.00815.13
7.0.130.0190.00715.11
7.0.120.0170.00715.07
7.0.110.0190.00715.00
7.0.100.0140.01115.12
7.0.90.0200.00615.04
7.0.80.0180.00615.19
7.0.70.0150.01115.22
7.0.60.0200.00814.88
7.0.50.0180.01015.27
7.0.40.0180.00813.89
7.0.30.0180.00713.78
7.0.20.0160.00813.86
7.0.10.0210.00913.74
7.0.00.0170.00913.84
5.6.400.0070.00314.40
5.6.390.0070.00314.45
5.6.380.0030.00814.14
5.6.370.0040.01114.23
5.6.360.0030.00714.21
5.6.350.0030.01314.43
5.6.340.0030.01014.27
5.6.330.0070.01014.32
5.6.320.0040.01114.63
5.6.310.0070.00714.75
5.6.300.0000.01214.64
5.6.290.0030.01014.27
5.6.280.0030.01014.11
5.6.270.0140.00014.47
5.6.260.0000.01114.66
5.6.250.0070.00714.02
5.6.240.0030.01214.36
5.6.230.0030.01014.27
5.6.220.0060.00914.53
5.6.210.0060.00614.40
5.6.200.0060.00614.24
5.6.190.0070.00414.55
5.6.180.0150.00014.18
5.6.170.0070.00714.60
5.6.160.0000.00914.55
5.6.150.0060.00614.57
5.6.140.0000.01514.15
5.6.130.0060.00614.63
5.6.120.0090.00314.49
5.6.110.0070.01314.42
5.6.100.0060.00914.38
5.6.90.0070.00714.28
5.6.80.0000.01414.04
5.6.70.0060.00614.06
5.6.60.0040.00414.52
5.6.50.0030.00914.20
5.6.40.0030.01114.29
5.6.30.0030.01014.17
5.6.20.0060.00314.29
5.6.10.0100.00314.43
5.6.00.0040.00814.35

preferences:
37.6 ms | 400 KiB | 5 Q