3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{"description 1": { "year0": "49", "year1": "48", "year2": "876786", "year3": "1234" } }'; $a = json_decode($json, true); $r = []; foreach($a['description 1'] as $k => $v){ $index = (int) filter_var($k, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); $r[$k] = ($index == 0) ? '' : $a['description 1']['year'.--$index]; } print_r($r);

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.0100.00217.55
8.4.120.0110.01024.18
8.4.110.0080.01121.46
8.4.100.0150.00517.71
8.4.90.0110.00920.69
8.4.80.0050.01318.74
8.4.70.0120.00917.81
8.4.60.0170.00418.80
8.4.50.0130.00820.38
8.4.40.0160.00619.27
8.4.30.0110.00718.52
8.4.20.0220.00018.73
8.4.10.0060.00317.75
8.3.260.0120.00717.41
8.3.250.0120.00618.87
8.3.240.0110.00817.21
8.3.230.0040.00416.42
8.3.220.0050.00319.12
8.3.210.0120.00618.88
8.3.200.0040.00416.60
8.3.190.0120.00717.13
8.3.180.0050.00616.47
8.3.170.0070.00717.29
8.3.160.0040.00420.09
8.3.150.0100.01016.47
8.3.140.0110.00017.13
8.3.130.0070.00318.37
8.3.120.0080.00020.77
8.3.110.0080.00816.48
8.3.100.0030.00618.42
8.3.90.0120.00326.77
8.3.80.0090.00018.43
8.3.70.0150.00616.50
8.3.60.0130.01016.63
8.3.50.0110.00417.99
8.3.40.0150.00018.84
8.3.30.0120.00418.72
8.3.20.0000.00820.65
8.3.10.0000.00723.66
8.3.00.0070.00022.51
8.2.290.0120.00522.15
8.2.280.0090.00518.57
8.2.270.0110.00716.94
8.2.260.0000.01017.17
8.2.250.0000.00818.32
8.2.240.0040.01216.87
8.2.230.0040.00420.94
8.2.220.0090.00024.06
8.2.210.0030.00726.77
8.2.200.0060.00316.75
8.2.190.0120.00916.63
8.2.180.0060.01216.63
8.2.170.0110.00419.09
8.2.160.0070.00722.96
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00426.16
8.2.110.0030.00620.31
8.2.100.0040.00717.91
8.2.90.0000.00817.72
8.2.80.0000.00918.05
8.2.70.0000.00818.05
8.2.60.0000.00818.19
8.2.50.0030.00518.10
8.2.40.0070.00019.46
8.2.30.0030.00519.23
8.2.20.0000.00718.13
8.2.10.0040.00419.22
8.2.00.0000.00719.36
8.1.330.0100.00521.95
8.1.320.0130.00616.05
8.1.310.0040.01418.54
8.1.300.0090.00620.09
8.1.290.0060.00318.88
8.1.280.0040.01125.92
8.1.270.0060.01322.09
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0050.00522.59
8.1.230.0070.00419.10
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0030.00617.48
8.1.190.0060.00317.22
8.1.180.0040.00418.10
8.1.170.0000.00818.45
8.1.160.0040.00418.82
8.1.150.0050.00218.90
8.1.140.0040.00420.90
8.1.130.0030.00320.01
8.1.120.0000.00717.48
8.1.110.0000.00817.32
8.1.100.0000.00717.50
8.1.90.0050.00317.36
8.1.80.0000.00817.46
8.1.70.0110.00017.46
8.1.60.0040.00417.62
8.1.50.0040.00417.43
8.1.40.0090.00317.47
8.1.30.0080.00017.55
8.1.20.0040.00417.57
8.1.10.0000.00917.58
8.1.00.0040.00417.45
8.0.300.0050.00519.63
8.0.290.0050.00316.75
8.0.280.0000.00718.45
8.0.270.0000.00717.17
8.0.260.0030.00320.26
8.0.250.0000.00716.94
8.0.240.0000.00716.88
8.0.230.0030.00516.83
8.0.220.0000.00716.88
8.0.210.0060.00316.82
8.0.200.0030.00316.96
8.0.190.0040.00416.83
8.0.180.0000.00716.88
8.0.170.0030.00516.99
8.0.160.0050.00316.85
8.0.150.0070.00316.79
8.0.140.0070.00016.74
8.0.130.0000.00613.32
8.0.120.0000.00816.88
8.0.110.0040.00416.91
8.0.100.0070.00016.79
8.0.90.0000.00716.90
8.0.80.0110.00416.90
8.0.70.0070.00016.76
8.0.60.0040.00416.77
8.0.50.0020.00516.90
8.0.30.0070.01117.04
8.0.20.0140.00516.96
8.0.10.0040.00417.02
8.0.00.0140.00417.03
7.4.330.0050.00016.84
7.4.320.0030.00316.40
7.4.300.0070.00016.64
7.4.290.0000.00816.50
7.4.280.0000.00816.63
7.4.270.0030.00316.62
7.4.260.0030.00313.28
7.4.250.0000.00716.57
7.4.240.0030.00516.57
7.4.230.0050.00216.62
7.4.220.0030.00416.46
7.4.210.0070.00916.54
7.4.200.0070.00016.27
7.4.140.0160.00317.86
7.4.130.0100.01016.52
7.4.120.0070.01316.32
7.4.110.0130.01016.64
7.4.100.0070.01116.52
7.4.90.0190.00016.59
7.4.80.0100.00619.39
7.4.70.0070.01016.46
7.4.60.0160.00616.48
7.4.50.0030.00716.48
7.4.40.0110.01016.48
7.4.00.0070.01114.55
7.3.330.0000.00716.34
7.3.320.0070.00013.16
7.3.310.0040.00416.34
7.3.300.0000.00716.24
7.3.290.0040.00416.37
7.3.280.0100.01016.27
7.3.260.0070.01216.42
7.3.240.0100.00616.55
7.3.230.0090.00916.40
7.3.210.0130.00616.41
7.3.200.0100.00716.67
7.3.190.0090.01316.53
7.3.180.0120.00616.37
7.3.170.0030.01216.40
7.3.160.0130.00316.61
7.3.90.0070.00714.55
7.3.80.0100.00414.77
7.3.70.0100.01014.69
7.3.60.0070.00714.65
7.3.50.0130.00014.63
7.3.40.0100.00314.92
7.3.30.0030.01714.39
7.3.20.0030.01016.56
7.3.10.0120.00616.34
7.3.00.0120.00616.64
7.2.330.0000.01716.75
7.2.320.0070.01016.76
7.2.310.0100.00716.59
7.2.300.0130.00316.48
7.2.290.0100.00616.70
7.2.220.0100.00314.56
7.2.210.0100.00315.18
7.2.200.0120.01215.01
7.2.190.0140.00015.03
7.2.180.0030.01114.83
7.2.170.0040.01514.78
7.2.160.0090.01214.87
7.2.150.0070.00816.83
7.2.140.0030.01716.64
7.2.130.0050.01016.84
7.2.120.0100.00716.74
7.2.110.0110.00416.83
7.2.100.0030.01116.51
7.2.90.0030.01116.87
7.2.80.0040.01116.61
7.2.70.0070.00716.92
7.2.60.0060.00916.93
7.2.50.0000.01716.78
7.2.40.0070.00716.96
7.2.30.0070.00716.79
7.2.20.0090.00916.90
7.2.10.0030.01216.83
7.2.00.0000.01316.56
7.1.320.0090.00315.68
7.1.310.0060.00615.64
7.1.300.0050.00815.55
7.1.290.0060.00615.58
7.1.280.0060.00615.69
7.1.270.0070.01115.71
7.1.260.0080.00615.81
7.1.250.0030.01015.87

preferences:
29.28 ms | 403 KiB | 5 Q