3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '[{ "11111111": { "id": "val_somevalue5555", "customer": { "32312": { "name": "jane doe" } } }, "2222222": { "id": "val_somevalue25", "customer": { "32312234": { "name": "jane doe" } } } }]'; $jsonarr = json_decode($json, true); $newarr = []; foreach($jsonarr as $value) { $key = key($value); $newarr[] = ['key' => $key, 'id' => $value[$key]['id']]; } var_dump($newarr);

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.130.0110.01017.51
8.4.120.0110.01022.54
8.4.110.0110.00919.06
8.4.100.0050.00417.43
8.4.90.0140.00622.29
8.4.80.0100.01117.70
8.4.70.0070.00517.82
8.4.60.0040.00618.84
8.4.50.0090.01022.21
8.4.40.0130.00617.87
8.4.30.0090.00017.57
8.4.20.0100.01019.11
8.4.10.0050.00317.57
8.3.260.0080.01016.85
8.3.250.0100.00818.72
8.3.240.0100.01017.25
8.3.230.0060.00816.72
8.3.220.0120.00717.37
8.3.210.0070.00816.85
8.3.200.0050.00416.51
8.3.190.0090.01017.13
8.3.180.0110.00518.19
8.3.170.0110.00717.32
8.3.160.0090.00920.57
8.3.150.0140.00418.67
8.3.140.0090.00616.79
8.3.130.0080.00018.53
8.3.120.0090.00019.00
8.3.110.0150.00420.94
8.3.100.0030.00624.06
8.3.90.0040.01126.77
8.3.80.0060.00318.31
8.3.70.0140.00418.16
8.3.60.0070.01518.30
8.3.50.0110.00318.22
8.3.40.0140.00718.84
8.3.30.0110.00718.77
8.3.20.0040.00421.85
8.3.10.0060.00323.39
8.3.00.0040.00421.80
8.2.290.0040.00420.49
8.2.280.0120.00818.38
8.2.270.0060.01317.03
8.2.260.0050.00317.00
8.2.250.0080.00018.55
8.2.240.0040.00418.75
8.2.230.0060.00322.58
8.2.220.0030.00537.54
8.2.210.0110.00726.77
8.2.200.0030.00718.41
8.2.190.0150.00416.75
8.2.180.0040.01116.75
8.2.170.0140.00022.96
8.2.160.0090.00622.11
8.2.150.0070.00724.18
8.2.140.0040.00424.66
8.2.130.0000.00720.29
8.2.120.0000.01026.35
8.2.110.0110.00021.13
8.2.100.0120.00019.60
8.2.90.0040.00417.88
8.2.80.0000.00817.97
8.2.70.0040.00418.04
8.2.60.0030.00618.28
8.2.50.0080.00018.22
8.2.40.0000.00720.42
8.2.30.0030.00519.20
8.2.20.0070.00318.16
8.2.10.0050.00218.19
8.2.00.0060.00318.02
8.1.330.0080.01021.84
8.1.320.0130.00616.13
8.1.310.0090.00918.49
8.1.300.0090.00020.27
8.1.290.0050.00530.84
8.1.280.0080.00825.92
8.1.270.0040.00422.14
8.1.260.0030.00526.35
8.1.250.0150.00028.09
8.1.240.0030.00622.12
8.1.230.0060.00619.09
8.1.220.0030.00717.74
8.1.210.0040.00418.77
8.1.200.0000.01317.25
8.1.190.0050.00317.23
8.1.180.0000.00818.10
8.1.170.0050.00318.51
8.1.160.0050.00218.82
8.1.150.0070.00018.82
8.1.140.0000.00718.94
8.1.130.0000.00717.88
8.1.120.0000.00717.45
8.1.110.0060.00317.48
8.1.100.0050.00217.38
8.1.90.0040.00417.51
8.1.80.0080.00317.29
8.1.70.0050.00217.41
8.1.60.0050.00217.60
8.1.50.0030.00617.54
8.1.40.0030.00717.58
8.1.30.0000.00817.73
8.1.20.0040.00417.63
8.1.10.0050.00317.46
8.1.00.0080.00017.34
8.0.300.0000.00719.79
8.0.290.0070.00016.75
8.0.280.0070.00018.51
8.0.270.0000.00717.33
8.0.260.0060.00017.33
8.0.250.0040.00417.04
8.0.240.0000.00717.01
8.0.230.0000.00716.98
8.0.220.0030.00316.82
8.0.210.0040.00416.88
8.0.200.0070.00316.97
8.0.190.0000.00716.90
8.0.180.0080.00016.89
8.0.170.0030.00616.92
8.0.160.0040.00416.89
8.0.150.0080.00016.83
8.0.140.0000.00816.87
8.0.130.0060.00013.34
8.0.120.0040.00416.84
8.0.110.0000.00816.84
8.0.100.0070.00016.94
8.0.90.0050.00316.96
8.0.80.0060.00916.96
8.0.70.0040.00416.73
8.0.60.0050.00216.95
8.0.50.0000.00816.80
8.0.30.0070.01217.19
8.0.20.0130.00917.40
8.0.10.0070.00017.02
8.0.00.0030.01416.77
7.4.330.0020.00215.55
7.4.320.0000.00616.53
7.4.300.0060.00016.43
7.4.290.0070.00016.59
7.4.280.0040.00416.52
7.4.270.0070.00016.57
7.4.260.0000.00716.48
7.4.250.0040.00416.56
7.4.240.0000.00816.43
7.4.230.0030.00316.66
7.4.220.0040.00316.66
7.4.210.0030.01016.68
7.4.200.0030.00316.59
7.4.160.0070.00916.35
7.4.150.0130.01017.40
7.4.140.0130.00717.86
7.4.130.0090.00916.55
7.4.120.0100.01016.47
7.4.110.0070.01016.50
7.4.100.0110.00716.67
7.4.90.0140.00416.50
7.4.80.0060.01719.39
7.4.70.0090.01416.56
7.4.60.0070.01016.58
7.4.50.0030.01216.38
7.4.40.0100.00716.58
7.4.30.0130.00716.45
7.4.10.0090.00915.04
7.4.00.0110.00614.86
7.3.330.0060.00013.23
7.3.320.0060.00013.21
7.3.310.0030.00316.20
7.3.300.0030.00316.36
7.3.290.0030.00316.29
7.3.280.0130.00616.29
7.3.270.0070.01417.40
7.3.260.0100.01116.41
7.3.250.0150.00216.40
7.3.240.0090.00816.39
7.3.230.0140.00916.36
7.3.210.0130.00516.50
7.3.200.0090.00916.48
7.3.190.0080.00816.45
7.3.180.0040.01416.59
7.3.170.0100.00716.63
7.3.160.0130.00916.54
7.3.130.0090.00915.04
7.3.120.0060.01314.59
7.3.110.0040.01215.03
7.3.100.0090.00315.10
7.3.90.0060.00615.04
7.3.80.0060.00614.80
7.3.70.0040.00814.79
7.3.60.0090.00614.49
7.3.50.0100.00314.82
7.3.40.0090.00614.62
7.3.30.0030.01014.97
7.3.20.0000.01216.86
7.3.10.0070.00416.44
7.3.00.0120.00316.93
7.2.330.0150.00916.81
7.2.320.0100.01316.77
7.2.310.0130.00416.48
7.2.300.0070.01716.77
7.2.290.0040.01216.78
7.2.260.0070.01315.03
7.2.250.0070.01115.11
7.2.240.0090.00615.07
7.2.230.0150.00015.17
7.2.220.0100.00315.31
7.2.210.0060.00615.37
7.2.200.0060.00614.98
7.2.190.0040.01114.79
7.2.180.0070.00715.07
7.2.170.0060.00615.07
7.2.160.0060.00614.90
7.2.150.0000.01416.77
7.2.140.0080.00317.16
7.2.130.0100.00317.16
7.2.120.0040.00816.73
7.2.110.0060.00916.94
7.2.100.0080.00816.92
7.2.90.0030.01216.64
7.2.80.0120.00617.05
7.2.70.0110.00316.94
7.2.60.0090.00716.68
7.2.50.0030.00816.76
7.2.40.0030.01416.95
7.2.30.0040.01116.71
7.2.20.0100.00016.72
7.2.10.0090.00016.70
7.2.00.0060.01418.64
7.1.330.0000.01415.95
7.1.320.0050.00516.04
7.1.310.0090.00615.70
7.1.300.0100.00315.88
7.1.290.0000.01315.87
7.1.280.0060.00615.84
7.1.270.0080.00815.80
7.1.260.0100.00315.96
7.1.250.0040.00415.61
7.1.240.0000.01515.75
7.1.230.0050.00816.01
7.1.220.0080.00415.88
7.1.210.0070.00715.81
7.1.200.0030.00915.97
7.1.190.0060.00615.72
7.1.180.0030.01015.63
7.1.170.0020.01315.70
7.1.160.0000.00915.89
7.1.150.0040.00815.80
7.1.140.0030.00715.93
7.1.130.0000.01315.96
7.1.120.0220.01217.02
7.1.110.0090.00816.81
7.1.100.0110.00716.75
7.1.90.0140.00716.61
7.1.80.0110.01116.58
7.1.70.0100.00616.18
7.1.60.0130.01328.10
7.1.50.0160.01027.81
7.1.40.0130.01527.52
7.1.30.0170.01327.77
7.1.20.0150.00927.69
7.1.10.0070.00915.71
7.1.00.0110.00615.92
7.0.330.0120.00315.36
7.0.320.0030.01315.13
7.0.310.0030.00615.57
7.0.300.0090.00615.59
7.0.290.0090.00315.45
7.0.280.0030.01315.26
7.0.270.0060.00315.13
7.0.260.0040.00715.45
7.0.250.0060.00615.61
7.0.240.0060.00615.57
7.0.230.0110.00415.34
7.0.220.0090.00615.62
7.0.210.0000.00915.19
7.0.200.0000.01315.21
7.0.190.0050.00815.54
7.0.180.0070.00715.30
7.0.170.0060.00615.26
7.0.160.0100.00715.55
7.0.150.0080.00815.41
7.0.140.0030.00615.44
7.0.130.0040.00415.39
7.0.120.0080.00415.55
7.0.110.0060.00915.50
7.0.100.0040.01115.39
7.0.90.0040.01115.48
7.0.80.0130.00315.31
7.0.70.0080.00415.22
7.0.60.0080.00815.17
7.0.50.0110.00315.34
7.0.40.0000.00813.41
7.0.30.0030.00613.58
7.0.20.0110.00313.47
7.0.10.0060.00613.54
7.0.00.0080.00313.46
5.6.400.0000.00814.63
5.6.390.0080.00414.08
5.6.380.0060.00613.85
5.6.370.0080.00414.52
5.6.360.0100.00314.26
5.6.350.0090.00614.65
5.6.340.0000.01014.38
5.6.330.0030.01014.62
5.6.320.0000.01114.28
5.6.310.0100.00314.75
5.6.300.0040.00714.44
5.6.290.0100.00714.48
5.6.280.0000.01214.42
5.6.270.0030.00914.21
5.6.260.0040.01114.41
5.6.250.0120.00314.45
5.6.240.0120.00414.39
5.6.230.0110.00714.21
5.6.220.0040.00814.41
5.6.210.0060.01014.27
5.6.200.0100.00714.31
5.6.190.0060.00614.45
5.6.180.0060.00614.40
5.6.170.0000.01414.19
5.6.160.0060.00614.40
5.6.150.0000.01314.50
5.6.140.0060.00914.30
5.6.130.0070.00714.13
5.6.120.0060.00314.46
5.6.110.0090.00614.18
5.6.100.0080.00614.20
5.6.90.0030.01014.28
5.6.80.0000.01114.50
5.6.70.0000.01114.39
5.6.60.0090.00414.40
5.6.50.0100.00314.11
5.6.40.0080.00414.18
5.6.30.0000.01314.32
5.6.20.0000.00914.19
5.6.10.0030.00714.49
5.6.00.0100.00314.25

preferences:
33.14 ms | 403 KiB | 5 Q