3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mergeAndBoolify($posted) { $result = []; foreach ($posted as $key1 => $value1) { if ($key1 === 'JsonData') { foreach (json_decode($value1, true) as $item) { foreach ($item as $key2 => $value2) { if (in_array($value2, ['true', 'false'])) { $value2 = json_decode($value2); } $result[$key2] = $value2; } } } else { $result[$key1] = $value1; } } return $result; } $_POST = [ 'JsonData' => '[{"firstname":"false"},{"lastname":"true"},{"email":""}]', 'otherdata' => 'otherdata' ]; var_export(mergeAndBoolify($_POST));

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.0150.00318.43
8.3.50.0070.00718.04
8.3.40.0140.00718.79
8.3.30.0070.01118.84
8.3.20.0040.00424.18
8.3.10.0000.00724.66
8.3.00.0090.00026.16
8.2.180.0070.01125.92
8.2.170.0150.00018.91
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00419.95
8.2.110.0090.00020.97
8.2.100.0190.00317.69
8.2.90.0000.00817.88
8.2.80.0050.00318.91
8.2.70.0060.00317.63
8.2.60.0070.00018.05
8.2.50.0000.00818.07
8.2.40.0050.00318.16
8.2.30.0040.00418.05
8.2.20.0000.00718.01
8.2.10.0000.00719.30
8.2.00.0040.00419.24
8.1.280.0100.01025.92
8.1.270.0040.00424.66
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0070.00320.99
8.1.230.0090.00317.89
8.1.220.0030.00517.74
8.1.210.0000.00818.77
8.1.200.0000.00917.13
8.1.190.0120.00316.99
8.1.180.0050.00318.10
8.1.170.0050.00318.68
8.1.160.0080.00018.80
8.1.150.0040.00418.82
8.1.140.0040.00418.95
8.1.130.0030.00320.02
8.1.120.0000.00817.36
8.1.110.0040.00417.45
8.1.100.0040.00417.46
8.1.90.0030.00517.50
8.1.80.0000.00717.46
8.1.70.0030.00317.40
8.1.60.0000.00917.48
8.1.50.0030.00617.41
8.1.40.0050.00317.51
8.1.30.0030.00517.49
8.1.20.0080.00017.52
8.1.10.0000.00817.53
8.1.00.0030.00617.52
8.0.300.0000.00718.77
8.0.290.0050.00316.75
8.0.280.0040.00418.52
8.0.270.0040.00417.89
8.0.260.0000.00620.23
8.0.250.0040.00417.00
8.0.240.0000.00716.88
8.0.230.0030.00316.87
8.0.220.0030.00316.79
8.0.210.0070.00016.92
8.0.200.0000.00816.84
8.0.190.0000.00816.80
8.0.180.0040.00416.92
8.0.170.0040.00416.80
8.0.160.0000.00716.79
8.0.150.0040.00416.91
8.0.140.0000.00816.87
8.0.130.0030.00313.37
8.0.120.0080.00016.77
8.0.110.0050.00216.93
8.0.100.0030.00516.91
8.0.90.0040.00416.78
8.0.80.0030.01416.88
8.0.70.0040.00416.89
8.0.60.0000.00716.95
8.0.50.0070.00016.77
8.0.30.0060.01217.13
8.0.20.0140.00717.21
8.0.10.0040.00416.98
8.0.00.0110.00816.95
7.4.330.0020.00215.55
7.4.320.0030.00316.50
7.4.300.0030.00316.51
7.4.290.0030.00316.52
7.4.280.0040.00416.59
7.4.270.0000.00716.53
7.4.260.0030.00313.33
7.4.250.0030.00316.51
7.4.240.0030.00316.61
7.4.230.0050.00216.40
7.4.220.0060.00216.55
7.4.210.0110.00716.56
7.4.200.0040.00416.63
7.4.130.0140.00316.48
7.4.120.0090.00916.48
7.4.110.0040.01416.48
7.4.100.0110.00616.35
7.4.90.0120.00616.67
7.4.80.0110.00716.73
7.4.70.0060.01216.34
7.4.60.0060.01116.74
7.4.50.0090.00916.51
7.4.40.0100.01416.64
7.4.30.0060.01616.50
7.4.20.0160.00316.46
7.4.10.0000.02216.79
7.4.00.0090.01416.33
7.3.330.0030.00516.18
7.3.320.0060.00013.36
7.3.310.0030.00316.39
7.3.300.0030.00316.32
7.3.290.0090.00616.37
7.3.280.0060.00916.32
7.3.260.0100.00716.36
7.3.230.0070.01016.41
7.3.210.0090.00916.58
7.3.200.0100.01316.68
7.3.190.0150.00316.43
7.3.180.0110.00716.51
7.3.170.0060.01816.32
7.3.160.0110.01116.32
7.3.150.0150.00316.20
7.3.140.0000.02016.50
7.3.130.0030.01416.42
7.3.120.0140.00316.35
7.3.110.0160.00416.48
7.3.100.0150.00316.57
7.3.90.0100.01416.21
7.3.80.0150.00916.51
7.3.70.0030.01616.36
7.3.60.0040.01516.41
7.3.50.0130.00516.25
7.3.40.0140.01016.33
7.3.30.0130.01016.40
7.3.20.0100.01316.36
7.3.10.0170.00316.41
7.3.00.0100.01016.32
7.2.330.0110.00616.81
7.2.320.0140.00416.61
7.2.310.0140.00316.63
7.2.300.0150.00816.61
7.2.290.0110.00716.64
7.2.280.0090.01416.67
7.2.270.0060.01316.59
7.2.260.0030.01616.64
7.2.250.0190.00616.80
7.2.240.0160.00316.83
7.2.230.0140.00916.55
7.2.220.0150.00916.76
7.2.210.0110.00816.60
7.2.200.0150.00516.41
7.2.190.0120.00616.45
7.2.180.0120.00616.52
7.2.170.0100.00916.55
7.2.160.0110.01116.46
7.2.150.0220.00716.79
7.2.140.0170.00416.71
7.2.130.0090.00916.71
7.2.120.0150.00416.66
7.2.110.0140.00816.63
7.2.100.0140.01016.57
7.2.90.0150.01116.45
7.2.80.0090.01316.41
7.2.70.0140.01116.49
7.2.60.0150.00916.53
7.2.50.0070.01416.59
7.2.40.0090.01816.51
7.2.30.0060.01216.64
7.2.20.0090.00916.52
7.2.10.0130.00616.63
7.2.00.0150.01016.49

preferences:
66.27 ms | 401 KiB | 5 Q