3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Translate a result array into a HTML table * * @author Aidan Lister <aidan@php.net> * @version 1.3.2 * @link http://aidanlister.com/2004/04/converting-arrays-to-human-readable-tables/ * @param array $array The result (numericaly keyed, associative inner) array. * @param bool $recursive Recursively generate tables for multi-dimensional arrays * @param string $null String to output for blank cells */ function array2table($array, $recursive = false, $null = '&nbsp;') { // Sanity check if (empty($array) || !is_array($array)) { return false; } if (!isset($array[0]) || !is_array($array[0])) { $array = array($array); } // Start the table $table = "<table>\n"; // The header $table .= "\t<tr>"; // Take the keys from the first row as the headings foreach (array_keys($array[0]) as $heading) { $table .= '<th>' . $heading . '</th>'; } $table .= "</tr>\n"; // The body foreach ($array as $row) { $table .= "\t<tr>" ; foreach ($row as $cell) { $table .= '<td>'; // Cast objects if (is_object($cell)) { $cell = (array) $cell; } if ($recursive === true && is_array($cell) && !empty($cell)) { // Recursive mode $table .= "\n" . array2table($cell, true, true) . "\n"; } else { $table .= (strlen($cell) > 0) ? htmlspecialchars((string) $cell) : $null; } $table .= '</td>'; } $table .= "</tr>\n"; } $table .= '</table>'; return $table; } $data ='[{ "ObjectId": 43, "ObjectName": "MEGA MELA", "ObjectTitle": "Event Created by API", "ObjectDescription": "NEW EVENT BY API", "ObjectLabel": "", "ObjectTypeId": 33, "MaxFieldsExpected": 5, "ObjectValueType": null, "ObjectControlType": "", "IsDeleted": true, "CreatedDate": "2019-05-22T07:56:03.767", "CreatedBy": null, "EditedDate": null, "EditedBy": null, "DeletedDate": null }, { "ObjectId": 44, "ObjectName": "Event x11", "ObjectTitle": "Event Created by API", "ObjectDescription": "NEW EVENT BY API", "ObjectLabel": "", "ObjectTypeId": 33, "MaxFieldsExpected": 5, "ObjectValueType": null, "ObjectControlType": "", "IsDeleted": true, "CreatedDate": "2019-05-23T00:33:50.7", "CreatedBy": null, "EditedDate": null, "EditedBy": null, "DeletedDate": null }]'; $jsonData = json_decode($data, TRUE); echo array2table($jsonData);

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.0090.01117.57
8.4.120.0120.00820.73
8.4.110.0130.00718.73
8.4.100.0060.00318.86
8.4.90.0110.00920.63
8.4.80.0090.01118.77
8.4.70.0040.00518.84
8.4.60.0110.00819.12
8.4.50.0070.01117.94
8.4.40.0150.00620.81
8.4.30.0100.01018.33
8.4.20.0100.01020.63
8.4.10.0100.01019.39
8.3.260.0110.01016.70
8.3.250.0080.00719.04
8.3.240.0110.00816.53
8.3.230.0050.00316.81
8.3.220.0060.00218.90
8.3.210.0120.00716.79
8.3.200.0050.00616.81
8.3.190.0060.01317.09
8.3.180.0100.01016.81
8.3.170.0120.00616.96
8.3.160.0150.00418.80
8.3.150.0150.00317.34
8.3.140.0080.00017.50
8.3.130.0040.00418.45
8.3.120.0040.00418.98
8.3.110.0030.00620.94
8.3.100.0080.00024.06
8.3.90.0180.00426.77
8.3.80.0060.00317.97
8.3.70.0140.00418.68
8.3.60.0140.00718.36
8.3.50.0140.00817.55
8.3.40.0150.00018.88
8.3.30.0140.00418.80
8.3.20.0080.00021.90
8.3.10.0080.00021.87
8.3.00.0050.00323.78
8.2.290.0070.00220.40
8.2.280.0120.00720.25
8.2.270.0090.00916.81
8.2.260.0080.00019.05
8.2.250.0040.00416.73
8.2.240.0030.00619.26
8.2.230.0040.00422.58
8.2.220.0000.00937.54
8.2.210.0120.00626.77
8.2.200.0060.00316.63
8.2.190.0100.01018.55
8.2.180.0120.00316.38
8.2.170.0080.00622.96
8.2.160.0120.00320.47
8.2.150.0030.00624.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0080.00019.48
8.2.110.0100.00019.27
8.2.100.0040.00817.91
8.2.90.0040.00418.09
8.2.80.0040.00420.36
8.2.70.0060.00317.50
8.2.60.0030.00617.75
8.2.50.0040.00418.05
8.2.40.0000.00819.48
8.2.30.0020.00519.34
8.2.20.0000.00818.10
8.2.10.0030.00618.88
8.2.00.0040.00419.22
8.1.330.0120.00918.28
8.1.320.0090.01016.38
8.1.310.0060.00316.61
8.1.300.0060.00319.79
8.1.290.0030.00730.84
8.1.280.0030.01325.92
8.1.270.0080.00022.67
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00922.14
8.1.230.0110.00020.91
8.1.220.0040.00417.74
8.1.210.0080.00018.90
8.1.200.0030.00617.23
8.1.190.0030.00619.01
8.1.180.0090.00418.10
8.1.170.0040.00417.62
8.1.160.0070.00218.89
8.1.150.0000.00818.98
8.1.140.0070.00018.93
8.1.130.0000.00920.19
8.1.120.0100.00017.54
8.1.110.0000.01117.39
8.1.100.0000.00717.48
8.1.90.0040.00417.39
8.1.80.0000.00717.49
8.1.70.0040.00417.48
8.1.60.0040.00417.61
8.1.50.0080.00017.47
8.1.40.0030.00517.55
8.1.30.0050.00317.73
8.1.20.0080.00017.63
8.1.10.0060.00317.63
8.1.00.0000.00817.62
8.0.300.0000.00720.33
8.0.290.0040.00416.75
8.0.280.0000.00718.49
8.0.270.0000.00918.67
8.0.260.0030.00318.49
8.0.250.0000.00716.92
8.0.240.0040.00416.89
8.0.230.0070.00016.91
8.0.220.0000.00716.97
8.0.210.0030.00316.84
8.0.200.0000.00617.00
8.0.190.0000.00816.96
8.0.180.0040.00416.91
8.0.170.0030.00616.89
8.0.160.0040.00416.90
8.0.150.0030.00616.93
8.0.140.0000.00716.79
8.0.130.0000.00613.30
8.0.120.0080.00414.52
8.0.110.0090.00314.55
8.0.100.0090.00214.50
8.0.90.0050.00514.53
8.0.80.0090.00414.50
8.0.70.0090.00414.51
8.0.60.0080.00314.54
8.0.50.0060.00514.54
8.0.30.0080.01015.62
8.0.20.0100.01015.54
8.0.10.0090.01115.23
8.0.00.0100.00715.92
7.4.330.0000.00715.55
7.4.320.0000.00716.59
7.4.300.0050.00216.54
7.4.290.0000.00716.65
7.4.280.0030.00516.68
7.4.270.0070.00016.40
7.4.260.0050.00316.67
7.4.250.0060.00114.40
7.4.240.0050.00614.95
7.4.230.0080.00314.43
7.4.220.0070.00414.39
7.4.210.0090.00715.23
7.4.200.0070.00514.41
7.4.190.0060.00613.33
7.4.180.0080.00413.41
7.4.160.0120.00415.65
7.4.150.0120.00514.98
7.4.140.0070.01014.94
7.4.130.0120.00715.21
7.4.120.0110.00815.25
7.4.110.0130.00815.26
7.4.100.0120.00715.22
7.4.90.0130.00615.21
7.4.80.0120.00715.81
7.4.70.0130.00715.25
7.4.60.0140.00515.22
7.4.50.0140.00615.13
7.4.40.0080.01015.11
7.4.30.0130.00814.87
7.4.20.0140.00614.87
7.4.10.0120.00614.86
7.4.00.0090.00814.96
7.3.330.0040.00213.44
7.3.320.0110.00413.31
7.3.310.0100.00514.30
7.3.300.0100.00614.31
7.3.290.0110.00514.34
7.3.280.0120.00615.35
7.3.270.0140.00914.89
7.3.260.0110.01015.83
7.3.250.0100.01114.89
7.3.240.0130.00814.97
7.3.230.0160.00615.20
7.3.220.0130.00814.78
7.3.210.0140.00715.14
7.3.200.0140.00415.13
7.3.190.0130.00815.15
7.3.180.0130.00915.13
7.3.170.0140.00715.18
7.3.160.0130.00615.11
7.3.150.0150.00714.80
7.3.140.0130.00714.83
7.3.130.0170.00314.87
7.3.120.0130.00614.79
7.3.110.0130.00714.82
7.3.100.0170.00614.78
7.3.90.0150.00515.06
7.3.80.0140.00514.89
7.3.70.0100.00714.94
7.3.60.0070.00715.00
7.3.50.0100.00614.91
7.3.40.0110.00714.86
7.3.30.0130.00614.96
7.3.20.0140.00615.96
7.3.10.0140.00515.99
7.3.00.0140.00715.91
7.2.340.0210.01314.93
7.2.330.0190.00815.36
7.2.320.0200.00715.37
7.2.310.0170.00915.25
7.2.300.0200.00715.29
7.2.290.0180.00815.30
7.2.280.0200.01015.03
7.2.270.0230.00714.97
7.2.260.0210.00814.99
7.2.250.0190.00814.94
7.2.240.0210.00614.92
7.2.230.0220.00715.00
7.2.220.0190.00715.01
7.2.210.0220.00715.01
7.2.200.0170.01215.01
7.2.190.0200.00815.08
7.2.180.0200.00515.06
7.2.170.0180.00815.10
7.2.160.0190.00715.11
7.2.150.0180.00716.24
7.2.140.0170.00816.13
7.2.130.0200.00416.33
7.2.120.0190.00516.15
7.2.110.0130.01116.23
7.2.100.0190.00816.21
7.2.90.0180.00716.10
7.2.80.0160.00816.21
7.2.70.0190.00816.16
7.2.60.0190.00616.17
7.2.50.0220.00616.23
7.2.40.0150.01116.25
7.2.30.0180.00816.12
7.2.20.0220.00516.17
7.2.10.0200.00816.24
7.2.00.0190.00616.25
7.1.330.0200.00415.03
7.1.320.0210.00614.98
7.1.310.0180.00815.07
7.1.300.0180.00415.12
7.1.290.0160.00615.15
7.1.280.0150.00915.12
7.1.270.0180.00615.10
7.1.260.0200.00815.08
7.1.250.0180.00615.10
7.1.240.0160.00814.87
7.1.230.0140.00815.00
7.1.220.0140.00914.95
7.1.210.0300.00414.99
7.1.200.0200.00714.91
7.1.190.0210.00414.99
7.1.180.0200.00614.95
7.1.170.0160.00914.85
7.1.160.0200.00314.93
7.1.150.0170.00814.94
7.1.140.0230.00414.90
7.1.130.0210.00414.87
7.1.120.0220.00514.92
7.1.110.0180.00915.02
7.1.100.0210.00514.90
7.1.90.0190.00714.94
7.1.80.0210.00815.02
7.1.70.0170.00914.85
7.1.60.0170.00714.94
7.1.50.0230.00315.00
7.1.40.0170.00815.00
7.1.30.0190.00515.00
7.1.20.0200.00514.97
7.1.10.0190.00714.97
7.1.00.0210.00514.88

preferences:
28.94 ms | 403 KiB | 5 Q