3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "data": { "id": 2, "title": "second evaluation form", "emp_position": "System Architecture", "rating": 5, "segments": [ { "segment_name": "Job Role ", "question": "How old are you?" }, { "segment_name": "360 Segments", "question": "What is your food?" }, { "segment_name": "360 Segments", "question": "sample question" } ] } }'; $data = json_decode($json,true); $segments = $data['data']['segments']; $new_segemnts = array(); foreach($segments as $segemnt) { $key = $segemnt['segment_name']; $new_segemnts[$key]['segment_name']=$segemnt['segment_name']; $new_segemnts[$key]['question_collection'][]=array("question"=>$segemnt['question']); } $data['data']['segments'] = array_values($new_segemnts); echo json_encode($data,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.3.60.0070.00716.75
8.3.50.0140.00316.36
8.3.40.0150.00618.91
8.3.30.0090.00618.84
8.3.20.0080.00020.34
8.3.10.0080.00023.68
8.3.00.0040.00423.67
8.2.180.0100.01018.16
8.2.170.0040.01518.92
8.2.160.0090.00920.29
8.2.150.0030.00624.18
8.2.140.0000.00824.66
8.2.130.0050.00326.16
8.2.120.0050.00319.89
8.2.110.0130.00320.38
8.2.100.0040.00717.91
8.2.90.0080.00017.75
8.2.80.0040.00418.92
8.2.70.0040.00417.63
8.2.60.0000.00817.75
8.2.50.0030.00517.75
8.2.40.0060.00319.30
8.2.30.0040.00419.34
8.2.20.0030.00518.02
8.2.10.0040.00418.27
8.2.00.0040.00418.12
8.1.280.0100.00325.92
8.1.270.0040.00423.91
8.1.260.0000.00828.09
8.1.250.0000.00728.09
8.1.240.0070.00423.91
8.1.230.0040.00720.78
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0050.00317.36
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0000.00818.65
8.1.160.0050.00318.86
8.1.150.0060.00318.90
8.1.140.0000.00719.09
8.1.130.0000.00818.90
8.1.120.0040.00417.52
8.1.110.0080.00017.39
8.1.100.0020.00517.39
8.1.90.0040.00417.49
8.1.80.0040.00417.52
8.1.70.0030.00317.49
8.1.60.0000.00817.61
8.1.50.0000.00817.49
8.1.40.0030.00617.50
8.1.30.0040.00417.52
8.1.20.0020.00517.63
8.1.10.0000.00817.60
8.1.00.0070.00017.56
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0030.00318.52
8.0.270.0030.00317.19
8.0.260.0030.00318.81
8.0.250.0040.00417.02
8.0.240.0030.00316.93
8.0.230.0040.00416.95
8.0.220.0080.00316.95
8.0.210.0000.00816.89
8.0.200.0040.00416.96
8.0.190.0040.00416.80
8.0.180.0040.00416.77
8.0.170.0070.00016.96
8.0.160.0030.00616.90
8.0.150.0000.00716.88
8.0.140.0040.00416.84
8.0.130.0000.00613.34
8.0.120.0000.00716.86
8.0.110.0070.00016.81
8.0.100.0040.00416.77
8.0.90.0070.00016.89
8.0.80.0070.01116.86
8.0.70.0050.00316.75
8.0.60.0000.00716.77
8.0.50.0000.00716.87
8.0.30.0050.01417.13
8.0.20.0110.00917.40
8.0.10.0000.00716.84
8.0.00.0150.00916.77
7.4.330.0000.00415.55
7.4.320.0000.00716.61
7.4.300.0000.00616.52
7.4.290.0000.00716.50
7.4.280.0040.00416.55
7.4.270.0030.00316.64
7.4.260.0000.00716.49
7.4.250.0000.00716.55
7.4.240.0040.00416.47
7.4.230.0000.00716.73
7.4.220.0070.01716.62
7.4.210.0100.01016.66
7.4.200.0000.00716.72
7.4.160.0110.00816.54
7.4.150.0090.00917.40
7.4.140.0120.00817.86
7.4.130.0100.01116.42
7.4.120.0110.00916.52
7.4.110.0140.00316.57
7.4.100.0090.00916.57
7.4.90.0080.01116.45
7.4.80.0090.00919.39
7.4.70.0120.00916.34
7.4.60.0070.00816.45
7.4.50.0090.00716.43
7.4.40.0120.00816.27
7.4.30.0120.00616.50
7.4.10.0000.01814.68
7.4.00.0060.01014.90
7.3.330.0000.00513.18
7.3.320.0030.00313.25
7.3.310.0030.00316.44
7.3.300.0000.00716.18
7.3.290.0100.00416.36
7.3.280.0090.00816.35
7.3.270.0120.00617.40
7.3.260.0110.01016.35
7.3.250.0130.00516.41
7.3.240.0090.01016.49
7.3.230.0080.01216.57
7.3.210.0110.00716.57
7.3.200.0100.00616.38
7.3.190.0130.00316.55
7.3.180.0070.00916.65
7.3.170.0120.00416.37
7.3.160.0000.01516.65
7.3.130.0080.00314.98
7.3.120.0090.00615.02
7.3.110.0040.01514.89
7.3.100.0030.01014.70
7.3.90.0040.00814.76
7.3.80.0030.01314.80
7.3.70.0060.00814.86
7.3.60.0030.01014.88
7.3.50.0030.01014.80
7.3.40.0030.00714.72
7.3.30.0100.00314.72
7.3.20.0030.00616.59
7.3.10.0060.00616.41
7.3.00.0060.00916.61
7.2.330.0180.00416.67
7.2.320.0060.01316.37
7.2.310.0100.01016.63
7.2.300.0090.00916.71
7.2.290.0120.00616.51
7.2.260.0110.00715.01
7.2.250.0110.00715.32
7.2.240.0080.00615.29
7.2.230.0080.00815.02
7.2.220.0030.00714.91
7.2.210.0030.01015.16
7.2.200.0030.00614.81
7.2.190.0040.00815.07
7.2.180.0090.00615.27
7.2.170.0030.00815.08
7.2.160.0100.00314.96
7.2.150.0070.00717.05
7.2.140.0000.01317.00
7.2.130.0060.00316.78
7.2.120.0030.00716.68
7.2.110.0040.01216.99
7.2.100.0060.00916.96
7.2.90.0000.01217.03
7.2.80.0070.01016.86
7.2.70.0070.00717.13
7.2.60.0110.00216.85
7.2.50.0040.00816.85
7.2.40.0030.01016.80
7.2.30.0090.00617.04
7.2.20.0070.00716.86
7.2.10.0040.00717.00
7.2.00.0040.00716.85
7.1.330.0000.01615.91
7.1.320.0110.00415.82
7.1.310.0120.00015.95
7.1.300.0040.00715.53
7.1.290.0000.01615.70
7.1.280.0030.00715.76
7.1.270.0000.01415.82
7.1.260.0060.00315.88
7.1.250.0030.00515.72
7.1.240.0030.00915.98
7.1.230.0000.01515.55
7.1.220.0030.00615.59
7.1.210.0030.00715.70
7.1.200.0030.01015.87
7.1.190.0030.00915.48
7.1.180.0080.00415.59
7.1.170.0070.00315.78
7.1.160.0040.01115.77
7.1.150.0060.00315.89
7.1.140.0030.01215.90
7.1.130.0040.01415.82
7.1.120.0000.01115.86
7.1.110.0020.01116.91
7.1.100.0020.01216.92
7.1.90.0050.00816.67
7.1.80.0110.00616.75
7.1.70.0030.00916.37
7.1.60.0110.01125.21
7.1.50.0100.01225.26
7.1.40.0130.00825.11
7.1.30.0120.00925.21
7.1.20.0090.01425.23
7.1.10.0070.00516.12
7.1.00.0050.01016.17
7.0.330.0090.00615.13
7.0.320.0070.00415.25
7.0.310.0060.00915.34
7.0.300.0090.00315.10
7.0.290.0030.01015.48
7.0.280.0050.00315.32
7.0.270.0030.01415.30
7.0.260.0040.01115.46
7.0.250.0060.00716.48
7.0.240.0080.00216.53
7.0.230.0030.01116.49
7.0.220.0070.00816.26
7.0.210.0070.00715.90
7.0.200.0020.01016.13
7.0.190.0030.01015.99
7.0.180.0040.01015.81
7.0.170.0080.00715.77
7.0.160.0070.00515.83
7.0.150.0060.00615.86
7.0.140.0030.01115.88
7.0.130.0030.01016.02
7.0.120.0020.01315.92
7.0.110.0110.00115.67
7.0.100.0030.01215.81
7.0.90.0050.00615.86
7.0.80.0030.01216.01
7.0.70.0080.00715.70
7.0.60.0070.00715.76
7.0.50.0020.01015.98
7.0.40.0060.00614.98
7.0.30.0060.00815.08
7.0.20.0050.00814.91
7.0.10.0020.01114.94
7.0.00.0040.00914.81
5.6.400.0060.00614.04
5.6.390.0000.01214.58
5.6.380.0000.01314.38
5.6.370.0000.00814.39
5.6.360.0060.00614.56
5.6.350.0060.01014.55
5.6.340.0030.00514.42
5.6.330.0150.00414.20
5.6.320.0000.01214.52
5.6.310.0000.01414.65
5.6.300.0050.00814.18
5.6.290.0070.00714.34
5.6.280.0100.00314.60
5.6.270.0120.00314.50
5.6.260.0070.00414.49
5.6.250.0080.00814.61
5.6.240.0080.00814.44
5.6.230.0060.01014.25
5.6.220.0110.00414.41
5.6.210.0030.01014.37
5.6.200.0110.00414.41
5.6.190.0100.00714.27
5.6.180.0100.01014.18
5.6.170.0070.00714.27
5.6.160.0080.00814.54
5.6.150.0100.00314.53
5.6.140.0030.00714.52
5.6.130.0060.00614.17
5.6.120.0070.01114.26
5.6.110.0060.00914.39
5.6.100.0000.01614.09
5.6.90.0000.01114.74
5.6.80.0040.01114.28
5.6.70.0030.01314.35
5.6.60.0060.00614.43
5.6.50.0070.00314.27
5.6.40.0070.00714.34
5.6.30.0090.00614.28
5.6.20.0070.01014.26
5.6.10.0100.00713.94
5.6.00.0060.00614.20

preferences:
32.39 ms | 400 KiB | 5 Q