3v4l.org

run code in 300+ PHP versions simultaneously
<?php $competence = json_decode('[ { "id": "21", "title": "blabla", "description": "blabla", "image": "blabla" }, { "id": "11", "title": "blabla", "description": "blabla", "image": "blabla" }, { "id": "26", "title": "blabla", "description": "blabla", "image": "blabla" } ]', true); $schedule = json_decode('[ { "id": "34", "parent_id": "21", "title": "blabla", "description": "blabla", "image": "blabla" }, { "id": "33", "parent_id": "21", "title": "blabla", "description": "blabla", "image": "blabla" }, { "id": "32", "parent_id": "11", "title": "blabla", "description": "blabla", "image": "blabla" }, { "id": "31", "parent_id": "26", "title": "blabla", "description": "blabla", "image": "blabla" } ]', true); foreach ($schedule as $s) { // find the parent_id in $competence if (($key = array_search($s['parent_id'], array_column($competence, 'id'))) !== false) { $competence[$key]['schedule'][] = $s; } } $response = array('competence' => $competence); echo json_encode($response, JSON_PRETTY_PRINT);

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.0140.00417.65
8.4.120.0130.00620.71
8.4.110.0110.00918.98
8.4.100.0150.00517.46
8.4.90.0120.00717.80
8.4.80.0080.00519.39
8.4.70.0130.00817.89
8.4.60.0130.00818.77
8.4.50.0130.00717.67
8.4.40.0120.00919.34
8.4.30.0100.01020.24
8.4.20.0130.00317.96
8.4.10.0060.00319.19
8.3.260.0140.00616.49
8.3.250.0040.00418.91
8.3.240.0110.00716.52
8.3.230.0120.00516.74
8.3.220.0110.00816.69
8.3.210.0090.00516.74
8.3.200.0080.00116.81
8.3.190.0120.00718.73
8.3.180.0070.01016.84
8.3.170.0040.00716.50
8.3.160.0080.01117.32
8.3.150.0090.00917.20
8.3.140.0080.00017.41
8.3.130.0040.00418.21
8.3.120.0130.00718.97
8.3.110.0060.00316.49
8.3.100.0100.00018.35
8.3.90.0080.00026.77
8.3.80.0090.00019.36
8.3.70.0070.01418.68
8.3.60.0110.00816.50
8.3.50.0050.00823.57
8.3.40.0120.00318.71
8.3.30.0060.00918.67
8.3.20.0040.00420.89
8.3.10.0030.00521.96
8.3.00.0040.00421.86
8.2.290.0120.00819.25
8.2.280.0070.00116.82
8.2.270.0130.00317.15
8.2.260.0000.01518.66
8.2.250.0070.01116.64
8.2.240.0030.00619.11
8.2.230.0050.00320.94
8.2.220.0060.00337.54
8.2.210.0150.00026.77
8.2.200.0030.00618.88
8.2.190.0070.01016.86
8.2.180.0100.01018.41
8.2.170.0040.01122.96
8.2.160.0030.01020.39
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0050.00226.16
8.2.120.0040.00426.16
8.2.110.0040.00422.25
8.2.100.0120.00017.78
8.2.90.0070.00317.75
8.2.80.0000.00818.92
8.2.70.0080.00017.50
8.2.60.0080.00017.50
8.2.50.0040.00417.75
8.2.40.0000.00821.13
8.2.30.0050.00219.32
8.2.20.0030.00518.01
8.2.10.0060.00319.32
8.2.00.0030.00319.20
8.1.330.0120.00616.11
8.1.320.0120.00817.77
8.1.310.0110.00718.69
8.1.300.0040.00818.62
8.1.290.0090.00030.84
8.1.280.0070.01425.92
8.1.270.0040.00423.91
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00623.88
8.1.230.0070.00420.88
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0000.00817.22
8.1.190.0040.00817.23
8.1.180.0000.01418.10
8.1.170.0080.00018.59
8.1.160.0040.00420.91
8.1.150.0040.00418.65
8.1.140.0040.00420.78
8.1.130.0060.00320.18
8.1.120.0070.00017.49
8.1.110.0080.00017.34
8.1.100.0000.00717.47
8.1.90.0040.00417.52
8.1.80.0040.00417.48
8.1.70.0030.00317.46
8.1.60.0090.00017.57
8.1.50.0030.00617.53
8.1.40.0000.00817.51
8.1.30.0040.00517.54
8.1.20.0030.00517.53
8.1.10.0040.00417.61
8.1.00.0040.00417.43
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00718.41
8.0.270.0050.00217.94
8.0.260.0030.00520.09
8.0.250.0030.00316.98
8.0.240.0000.00916.98
8.0.230.0020.00416.80
8.0.220.0000.00816.87
8.0.210.0000.00716.86
8.0.200.0030.00316.96
8.0.190.0000.00816.84
8.0.180.0050.00316.84
8.0.170.0030.00716.93
8.0.160.0030.00616.80
8.0.150.0000.00816.86
8.0.140.0040.00416.75
8.0.130.0050.00013.31
8.0.120.0000.00816.95
8.0.110.0020.00516.75
8.0.100.0050.00216.92
8.0.90.0040.00416.92
8.0.80.0100.00516.80
8.0.70.0030.00316.89
8.0.60.0050.00216.94
8.0.50.0040.00416.77
8.0.30.0030.02216.87
8.0.20.0150.00417.23
8.0.10.0040.00416.86
8.0.00.0090.00916.96
7.4.330.0000.00516.70
7.4.320.0000.00616.54
7.4.300.0030.00316.54
7.4.290.0030.00516.52
7.4.280.0080.00216.65
7.4.270.0000.00816.59
7.4.260.0050.00013.37
7.4.250.0070.00016.42
7.4.240.0070.00016.57
7.4.230.0030.00416.61
7.4.220.0030.00416.66
7.4.210.0090.00716.54
7.4.200.0030.00316.35
7.4.130.0180.00016.52
7.4.120.0130.00316.50
7.4.110.0120.00616.64
7.4.100.0140.00316.64
7.4.90.0090.00916.59
7.4.80.0130.00319.39
7.4.70.0100.00716.65
7.4.60.0030.01416.52
7.4.50.0090.00316.58
7.4.40.0120.01016.40
7.4.10.0070.01214.79
7.4.00.0090.00615.04
7.3.330.0000.00716.40
7.3.320.0000.00513.12
7.3.310.0000.00716.16
7.3.300.0050.00316.25
7.3.290.0060.01116.35
7.3.260.0120.00616.42
7.3.240.0060.01116.51
7.3.230.0100.01016.38
7.3.210.0160.00316.64
7.3.200.0030.01616.52
7.3.190.0030.01516.67
7.3.180.0060.00916.37
7.3.170.0070.01716.38
7.3.160.0120.00916.47
7.3.130.0080.00614.94
7.3.120.0070.00714.59
7.3.110.0030.01114.59
7.3.100.0080.00414.72
7.3.90.0080.00814.73
7.3.80.0000.01414.73
7.3.70.0050.00814.80
7.3.60.0030.01014.81
7.3.50.0000.01314.55
7.3.40.0070.00714.56
7.3.30.0070.00714.82
7.3.20.0150.00414.42
7.3.10.0100.00514.93
7.3.00.0090.00714.76
7.2.330.0180.00016.77
7.2.320.0120.00616.55
7.2.310.0100.00616.80
7.2.300.0150.00316.73
7.2.290.0040.01216.77
7.2.260.0120.00614.91
7.2.250.0040.01114.96
7.2.240.0060.00914.53
7.2.230.0070.00714.90
7.2.220.0100.00514.96
7.2.210.0070.00714.90
7.2.200.0000.01414.84
7.2.190.0000.01514.93
7.2.180.0090.00614.98
7.2.170.0080.00614.82
7.2.160.0060.00914.79
7.2.150.0100.00714.83
7.2.140.0070.01415.10
7.2.130.0060.01114.81
7.2.120.0080.00814.95
7.2.110.0060.00914.97
7.2.100.0030.01114.82
7.2.90.0060.01015.13
7.2.80.0120.00315.08
7.2.70.0060.00914.84
7.2.60.0030.01114.81
7.2.50.0030.01014.72
7.2.40.0030.01214.99
7.2.30.0060.00915.07
7.2.20.0040.01114.79
7.2.10.0090.00614.64
7.2.00.0090.00614.54

preferences:
26.53 ms | 403 KiB | 5 Q