3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '[ "foo", "bar", "info", { "data": "{\"parts\":[{\"id\":1,\"serial\":\"19777\",\"type\":\"NONE\",\"key\":\"\"}]}", "vendor": "Test", "message": "Hello world" } ]'; $arr = json_decode($json, true); recurse($arr); // find json elements inside $arr, and decode function recurse(array &$arr) { foreach ($arr as $key => &$value) { if (is_array($value)) { recurse($value); } else { if (is_object(json_decode($value))) { $value = json_decode($value, true); } } } } echo '<pre>'; print_r($arr); echo '</pre>';

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.120.0130.00824.19
8.4.110.0100.00819.05
8.4.100.0030.00618.02
8.4.90.0110.01020.49
8.4.80.0090.01218.10
8.4.70.0160.00717.72
8.4.60.0090.01020.57
8.4.50.0150.00619.54
8.4.40.0060.00317.67
8.4.30.0120.00820.52
8.4.20.0100.00717.96
8.4.10.0000.00819.49
8.3.250.0120.00716.61
8.3.240.0100.00917.09
8.3.230.0090.01018.46
8.3.220.0110.00819.19
8.3.210.0140.00416.69
8.3.200.0050.00416.84
8.3.190.0120.00717.01
8.3.180.0130.00622.48
8.3.170.0150.00320.68
8.3.160.0060.01516.63
8.3.150.0160.00318.91
8.3.140.0040.00416.89
8.3.130.0080.00018.48
8.3.120.0120.00418.63
8.3.110.0030.00620.94
8.3.100.0080.00516.62
8.3.90.0150.00917.41
8.3.80.0080.00817.81
8.3.70.0160.00316.50
8.3.60.0150.00516.30
8.3.50.0140.00621.13
8.3.40.0120.00519.45
8.3.30.0090.00817.90
8.3.20.0130.00120.78
8.3.10.0100.00420.96
8.3.00.0110.00221.75
8.2.290.0120.00820.64
8.2.280.0080.00718.25
8.2.270.0090.00917.24
8.2.260.0040.00418.85
8.2.250.0070.01316.71
8.2.240.0040.00416.78
8.2.230.0100.01022.58
8.2.220.0150.00516.25
8.2.210.0110.00221.71
8.2.200.0110.00416.50
8.2.190.0120.00616.61
8.2.180.0150.00321.14
8.2.170.0120.00918.04
8.2.160.0120.00620.17
8.2.150.0130.00121.51
8.2.140.0090.00620.96
8.2.130.0100.00421.77
8.2.120.0120.00219.29
8.2.110.0110.00518.92
8.2.100.0130.00417.39
8.2.90.0090.00517.56
8.2.80.0080.00618.02
8.2.70.0080.00317.44
8.2.60.0020.00917.44
8.2.50.0050.00517.37
8.2.40.0090.00217.77
8.2.30.0100.00617.71
8.2.20.0080.00617.66
8.2.10.0100.00518.42
8.2.00.0110.00218.25
8.1.330.0140.00422.00
8.1.320.0090.01016.11
8.1.310.0120.00316.88
8.1.300.0040.01518.41
8.1.290.0080.00617.38
8.1.280.0100.00720.96
8.1.270.0080.00620.56
8.1.260.0090.00621.68
8.1.250.0110.00322.61
8.1.240.0110.00619.33
8.1.230.0130.00119.10
8.1.220.0080.00517.36
8.1.210.0130.00017.95
8.1.200.0080.00617.29
8.1.190.0090.00417.17
8.1.180.0110.00417.49
8.1.170.0040.00818.17
8.1.160.0110.00218.04
8.1.150.0060.00717.88
8.1.140.0070.00718.06
8.1.130.0070.00618.58
8.1.120.0070.00517.18
8.1.110.0120.00217.00
8.1.100.0060.00817.29
8.1.90.0070.00517.32
8.1.80.0060.00717.31
8.1.70.0020.00717.39
8.1.60.0050.00417.56
8.1.50.0050.00517.37
8.1.40.0060.00417.32
8.1.30.0030.00617.61
8.1.20.0040.00417.42
8.1.10.0050.00417.48
8.1.00.0060.00317.33
8.0.300.0120.00217.62
8.0.290.0100.00316.55
8.0.280.0100.00317.22
8.0.270.0100.00417.35
8.0.260.0110.00118.34
8.0.250.0100.00416.70
8.0.240.0100.00316.85
8.0.230.0090.00416.83
8.0.220.0090.00316.75
8.0.210.0090.00316.73
8.0.200.0090.00516.68
8.0.190.0090.00416.77
8.0.180.0100.00516.75
8.0.170.0110.00216.68
8.0.160.0080.00516.85
8.0.150.0110.00416.62
8.0.140.0120.00116.58
8.0.130.0040.00814.88
8.0.120.0090.00416.76
8.0.110.0080.00516.69
8.0.100.0070.00516.66
8.0.90.0090.00416.61
8.0.80.0120.00416.70
8.0.70.0110.00216.77
8.0.60.0070.00616.51
8.0.50.0100.00316.78
8.0.30.0150.00316.78
8.0.20.0130.00616.90
8.0.10.0080.00516.86
8.0.00.0150.00316.66
7.4.330.0100.00216.47
7.4.320.0070.00516.26
7.4.300.0050.00716.21
7.4.290.0110.00116.43
7.4.280.0120.00216.30
7.4.270.0090.00416.38
7.4.260.0040.00914.77
7.4.250.0090.00516.28
7.4.240.0050.00716.27
7.4.230.0100.00316.40
7.4.220.0050.00516.45
7.4.210.0070.00716.40
7.4.200.0080.00416.34
7.4.190.0180.00016.25
7.4.180.0150.00316.13
7.4.160.0120.00415.98
7.4.150.0170.00016.00
7.4.140.0120.00515.88
7.4.130.0150.00416.41
7.4.120.0050.01316.24
7.4.110.0200.00616.23
7.4.100.0190.00516.23
7.4.90.0250.00316.33
7.4.80.0240.00316.31
7.4.70.0180.01116.20
7.4.60.0230.00416.16
7.4.50.0200.00816.29
7.4.40.0150.01116.08
7.4.30.0200.00916.16
7.4.20.0180.00816.32
7.4.10.0210.00516.32
7.4.00.0140.00616.45
7.3.330.0100.00215.99
7.3.320.0090.00314.46
7.3.310.0080.00316.24
7.3.300.0120.00016.08
7.3.290.0110.00516.21
7.3.280.0140.00315.88
7.3.270.0130.00415.50
7.3.260.0100.00616.11
7.3.250.0100.00515.98
7.3.240.0110.00615.75
7.3.230.0200.00716.05
7.3.220.0210.00216.07
7.3.210.0240.00516.19
7.3.200.0180.01016.09
7.3.190.0210.00716.26
7.3.180.0210.00715.96
7.3.170.0210.00916.13
7.3.160.0160.01016.04
7.3.150.0240.00416.08
7.3.140.0250.00316.16
7.3.130.0250.00416.21
7.3.120.0190.00815.99
7.3.110.0200.00816.03
7.3.100.0210.00715.91
7.3.90.0210.00816.15
7.3.80.0190.00716.20
7.3.70.0200.00716.06
7.3.60.0210.00616.26
7.3.50.0190.00916.20
7.3.40.0250.00216.08
7.3.30.0200.00716.09
7.3.20.0180.01117.23
7.3.10.0200.00917.26
7.3.00.0210.00817.08
7.2.340.0170.01016.11
7.2.330.0210.01116.25
7.2.320.0230.00516.29
7.2.310.0250.00316.23
7.2.300.0210.00816.43
7.2.290.0180.01016.28
7.2.280.0200.00716.32
7.2.270.0170.00916.15
7.2.260.0240.00416.39
7.2.250.0150.01116.31
7.2.240.0170.01116.29
7.2.230.0210.00616.16
7.2.220.0190.00816.23
7.2.210.0220.00816.27
7.2.200.0160.01116.50
7.2.190.0220.00616.46
7.2.180.0190.00716.29
7.2.170.0170.01016.50
7.2.160.0220.00916.36
7.2.150.0210.00917.37
7.2.140.0210.01117.29
7.2.130.0220.00917.30
7.2.120.0240.00417.31
7.2.110.0230.00417.37
7.2.100.0190.00817.34
7.2.90.0250.00717.41
7.2.80.0190.00917.26
7.2.70.0230.00617.45
7.2.60.0210.00817.26
7.2.50.0210.00817.31
7.2.40.0140.01617.39
7.2.30.0220.00817.37
7.2.20.0240.00517.38
7.2.10.0190.01117.34
7.2.00.0200.00817.40

preferences:
31.69 ms | 403 KiB | 5 Q